How to create Color shades.

For example if red color means I have to reduce the intensity gradually and i have to create minimum 5 shade colors of red.

Anyone help me How to do color shades, any algorithm is there?

Printable View

- Mar 20th 2009, 03:32 AMkumarColors
How to create Color shades.

For example if red color means I have to reduce the intensity gradually and i have to create minimum 5 shade colors of red.

Anyone help me How to do color shades, any algorithm is there? - Mar 20th 2009, 04:15 AMCaptainBlack
Not very clear, please clarify what you want to ask.

You could start by saying how you are representing colour (probably 24 bit, 8 bits per channel for RGB, but if you do not say so we are only guessing).

How about:

$\displaystyle \alpha [255,0,0] + (1-\alpha) [255,255,255]\ : \ \alpha \in [0,1]$

rounded to the nearest integers in $\displaystyle [0,255]$

CB - Mar 20th 2009, 04:43 AMkumar
Thanks for your reply.

I dont know whether ie. 24bit or 8bit, Because I dont know more about colors.

I didn't understand that formula. how to apply that formula. please explain.

Red means 255, 0, 0 what I have to do with alpha value. - Mar 20th 2009, 05:51 AMHallsofIvyQuote:

256= 2^8

In any case, 255/5= 51 so a loop such as i= 0 to 4, step 51 to get 0, 51, 102, 153, 204, 255 will work.