toColorSpace<T extends Ray> method

T toColorSpace<T extends Ray>()

Converts this color to a different color space.

Implementation

T toColorSpace<T extends Ray>() {
  if (T == RayRgb8) return toRgb8() as T;
  if (T == RayRgb16) return toRgb16() as T;
  if (T == RayHsl) return toHsl() as T;
  if (T == RayOklab) return toOklab() as T;
  if (T == RayOklch) return toOklch() as T;

  return this as T;
}