A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Color manipulation

  1. #1
    Join Date
    Jul 2008

    Color manipulation


    I often use boxes which use 3 colours. They have a base color, which can be anything, preferably quite bright, and fairly colourful.

    This is the first colour of the gradient that fills the box. Then second colour is slightly darker, and slightly more saturated. The third colour is further darkened, and further saturated.

    My question is, how could I make these 3 colours (assuming the user selects the 'base colour') themselves. I have an image to help anyone visualise this. Any help/discussion really appreciated!

    (in case that doesn't show up, http://djave.co.uk/images/hosted/colormanipulation.jpg)

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Austin, TX
    You are talking about color in terms of hue, saturation, and value, so you will want to manipulate the color in HSV rather than RGB. You can find RGB->HSV and HSV->RGB algorithms out there (and there's probably an AS3 package with them already).


    So take the RGB color from the colorpicker or however the user selects it, turn it to HSV, then increase Saturation and Value components a bit, then translate back to RGB. Maybe it's decrease Value. I don't remember.

  3. #3
    Join Date
    Jul 2008
    Thank you very much buddy. Will get on this.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center