convert static method
dynamic
convert(
- dynamic color,
- dynamic sourceColorSpace,
- dynamic targetColorSpace
Implementation
static convert( color, sourceColorSpace, targetColorSpace ) {
if ( legacyMode || sourceColorSpace == targetColorSpace || ! sourceColorSpace || ! targetColorSpace ) {
return color;
}
if ( FN[ sourceColorSpace ] != null && FN[ sourceColorSpace ]![ targetColorSpace ] != null ) {
var fn = FN[ sourceColorSpace ]![ targetColorSpace ]!;
color.r = fn( color.r );
color.g = fn( color.g );
color.b = fn( color.b );
return color;
}
throw( 'Unsupported color space conversion.' );
}