VtRenderColors.fromNative constructor

VtRenderColors.fromNative(
  1. GhosttyRenderStateColors native
)

Implementation

factory VtRenderColors.fromNative(bindings.GhosttyRenderStateColors native) {
  return VtRenderColors(
    background: _rgbFromNative(native.background),
    foreground: _rgbFromNative(native.foreground),
    cursor: native.cursor_has_value ? _rgbFromNative(native.cursor) : null,
    palette: List<VtRgbColor>.generate(
      256,
      (index) => _rgbFromNative(native.palette[index]),
    ),
  );
}