VtStyleColor.fromNative constructor

VtStyleColor.fromNative(
  1. GhosttyStyleColor native
)

Implementation

factory VtStyleColor.fromNative(bindings.GhosttyStyleColor native) {
  return switch (native.tag) {
    bindings.GhosttyStyleColorTag.GHOSTTY_STYLE_COLOR_NONE =>
      const VtStyleColor.none(),
    bindings.GhosttyStyleColorTag.GHOSTTY_STYLE_COLOR_PALETTE =>
      VtStyleColor.palette(native.value.palette),
    bindings.GhosttyStyleColorTag.GHOSTTY_STYLE_COLOR_RGB => VtStyleColor.rgb(
      _rgbFromNative(native.value.rgb),
    ),
  };
}