bufferSetCellWithAlphaBlending method

void bufferSetCellWithAlphaBlending(
  1. OptimizedBufferHandle buffer,
  2. int x,
  3. int y,
  4. int character,
  5. Color foreground,
  6. Color background,
  7. int attributes,
)

Writes one encoded cell through OpenTUI's alpha-blending path.

Implementation

void bufferSetCellWithAlphaBlending(
  OptimizedBufferHandle buffer,
  int x,
  int y,
  int character,
  Color foreground,
  Color background,
  int attributes,
) {
  _checkUnsignedAbi(x, 0xFFFFFFFF, 'x');
  _checkUnsignedAbi(y, 0xFFFFFFFF, 'y');
  _checkUnsignedAbi(character, 0xFFFFFFFF, 'character');
  _checkUnsignedAbi(attributes, 0xFFFFFFFF, 'attributes');
  validateColorChannels(foreground, name: 'foreground');
  validateColorChannels(background, name: 'background');
  _guardAlloc('Failed to set buffer cell', (allocator) {
    _native.bufferSetCellWithAlphaBlending(
      buffer.value,
      x,
      y,
      character,
      _colorToNative(foreground, allocator),
      _colorToNative(background, allocator),
      attributes,
    );
  });
}