1. Colors

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?

2. Originally Posted by kumar

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?

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).

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

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

CB

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.

4. 256= 2^8
so 0 to 255 is 8 bits or one byte.

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.