Flash 8 - Color Conversion Utility Class

As i mentioned earlier on, a good understanding of the different color spaces and number systems is necessary to work effectively with actionscript and the new expressiveness classes in Flash Player 8.

Ive been messing around with these classes for a good while now and during that time i have built up a library of methods that i use regularly to convert between different color spaces and number systems, currently the class can do the following:

  • convert red, green, blue values into a 24-bit hexadecimal color value
  • convert alpha, red, green, blue values into a 32-bit hexadecimal color value
  • convert a 24-bit hexadecimal color value into red, green, blue values
  • convert a 32-bit hexadecimal color value into alpha, red, green, blue values
  • convert red, blue, green values into hue, saturation, brightness values
  • convert hue, saturation, brightness values into red, green, blue values
  • convert a 24 bit hexadecimal color value into hue, saturation, brightness values
  • convert hue, saturation, brightness values into a 24-bit hexadecimal color value
  • convert a hexadecimal color value into a base 16 hexadecimal color string

No doubt, it will come in very useful to others, so im making it available to download here.

This class is work on-going, so will be updated and fixed as and when necessary.

Comments are closed.