resolve method
- VtStyleColor color, {
- VtRgbColor? defaultColor,
Resolves color to an RGB value using this render-state palette.
Returns defaultColor when color is unset.
Implementation
VtRgbColor? resolve(VtStyleColor color, {VtRgbColor? defaultColor}) {
return switch (color.tag) {
bindings.GhosttyStyleColorTag.GHOSTTY_STYLE_COLOR_NONE => defaultColor,
bindings.GhosttyStyleColorTag.GHOSTTY_STYLE_COLOR_PALETTE => paletteAt(
color.paletteIndex!,
),
bindings.GhosttyStyleColorTag.GHOSTTY_STYLE_COLOR_RGB => color.rgb,
};
}