Converting color values
Is there any simple way to convert an RGB color to and from other colors (e.g. HSL, Lab)?
I thought I had a way to have SolidColor do the conversion, but I can't seem to get it to work...
Is there any simple way to convert an RGB color to and from other colors (e.g. HSL, Lab)?
I thought I had a way to have SolidColor do the conversion, but I can't seem to get it to work...
Does putting the solid color in the app's foreground then pulling back the other values not get you what you need? I don't do much of this so I could be a mile off…
var rgbSC = new SolidColor() rgbSC.rgb.red=0; rgbSC.rgb.green=204; rgbSC.rgb.blue=100; app.foregroundColor = rgbSC; $.writeln(app.foregroundColor.cmyk.cyan); $.writeln(app.foregroundColor.cmyk.magenta); $.writeln(app.foregroundColor.cmyk.yellow); $.writeln(app.foregroundColor.cmyk.black); $.writeln(app.foregroundColor.hsb.brightness); $.writeln(app.foregroundColor.hsb.hue); $.writeln(app.foregroundColor.hsb.saturation);
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.