Click here to Skip to main content
15,887,397 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
any body tell me how mix color
1:for ex if i want dark magenta value how this
i know the magenta gcolor3f(1.0,0.0,1.0)


2:again iwant get dark red color vaule
gcolor3f(1.0,0.0,0.0) this for red
Posted
Comments
Nelek 1-Jun-13 16:03pm    
Ehhmmmm... what?

If you want a darker variant of an existing color, just lower all R,G, B values proportionally. For example, to darken the magenta color (1.0, 0.0, 1.0), multiply all components by say 0.5 and you get (0.5, 0.0, 0.5).

An good method for experimenting with color values is to just open the Windows color dialog and see the effect of changing one ore multiple values. Also, experiment with different color systems, like HSI and see how they relate to each other.
 
Share this answer
 
The following logic can be used to get the dark version of a particular color.

fNewColorR = fColorR * fIntensity;
fNewColorG = fColorG * fIntensity;
fNewColorB = fColorB * fIntensity;

Dark version of a particular color can be achieved by a decreasing the value of fIntensity.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900