I want to define color value by using HSL(Hue, Saturation, Lightness) not RGB.
Does actionscript have a function for that?
For example, I want to write code like the following:
var color:int = hsl(10, 90, 30);
sprite.graphics.lineStyle(2, color);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No built-in way, but there are many functions available online to do the conversion. For example these two JavaScript functions (they might need to be slightly refactored to compile with AS3 but it should just be minor changes):
Then use
ColorTransformto get theuintRGB value: