I have two colors. I need to add the R, G, & B components and return a new color. I am having trouble.
Printable View
I have two colors. I need to add the R, G, & B components and return a new color. I am having trouble.
How do you store the colours? And how do you want to mix them?
- ØØ -
well simply do
int r, g, b;
r = color1.R +color2.R .....
same with g and b
then check to see if any of the new r g b values exceed 255. If so, set them to 255
There is THREE ways of handling oversaturated colours. Clamping, scaling, and clipping...;)
- ØØ -
shut up:DQuote:
Originally Posted by NoteMe
you should have a phd in this field by now :bigyello: why don't you post about those
Because I am lazy. I don't want to write 3 pages if he doesn't care about it..:D
ANd yes..where is my Ph.d...:)
- ØØ -
This is actually what I tried before posting. The properties are read only.Quote:
well simply do
int r, g, b;
r = color1.R +color2.R .....
same with g and b
Yes but you can create a new color from the new numbers and use that.Quote:
Originally Posted by Sneeden
yes just add the values to integer variables as I said (int r, g, b;)Quote:
Originally Posted by Sneeden
then do Color newColor = Color.FromArgb (0, r,g,b);
Thx Mr Polite. I missed that function. It only has the r,g,b args, no alpha.
1000 appreciations.
Sneed
you're welcome:D read my signature:DQuote:
Originally Posted by Sneeden