VtRgbColor.fromNative constructor

VtRgbColor.fromNative(
  1. GhosttyColorRgb native
)

Implementation

factory VtRgbColor.fromNative(bindings.GhosttyColorRgb native) {
  final r = calloc<ffi.Uint8>();
  final g = calloc<ffi.Uint8>();
  final b = calloc<ffi.Uint8>();
  try {
    bindings.ghostty_color_rgb_get(native, r, g, b);
    return VtRgbColor(r.value, g.value, b.value);
  } finally {
    calloc.free(r);
    calloc.free(g);
    calloc.free(b);
  }
}