Click to See Complete Forum and Search --> : mixing color
Sneeden
Sep 19th, 2005, 11:10 AM
I have two colors. I need to add the R, G, & B components and return a new color. I am having trouble.
NoteMe
Sep 19th, 2005, 11:48 AM
How do you store the colours? And how do you want to mix them?
- ии -
MrPolite
Sep 19th, 2005, 12:00 PM
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
NoteMe
Sep 19th, 2005, 12:15 PM
There is THREE ways of handling oversaturated colours. Clamping, scaling, and clipping...;)
- ии -
MrPolite
Sep 19th, 2005, 12:24 PM
There is THREE ways of handling oversaturated colours. Clamping, scaling, and clipping...;)
- ии -
shut up:D
you should have a phd in this field by now :bigyello: why don't you post about those
NoteMe
Sep 19th, 2005, 12:39 PM
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...:)
- ии -
Sneeden
Sep 20th, 2005, 03:34 PM
well simply do
int r, g, b;
r = color1.R +color2.R .....
same with g and b
This is actually what I tried before posting. The properties are read only.
grilkip
Sep 20th, 2005, 04:17 PM
This is actually what I tried before posting. The properties are read only.
Yes but you can create a new color from the new numbers and use that.
MrPolite
Sep 20th, 2005, 05:22 PM
This is actually what I tried before posting. The properties are read only.
yes just add the values to integer variables as I said (int r, g, b;)
then do Color newColor = Color.FromArgb (0, r,g,b);
Sneeden
Sep 21st, 2005, 10:23 AM
Thx Mr Polite. I missed that function. It only has the r,g,b args, no alpha.
1000 appreciations.
Sneed
MrPolite
Sep 21st, 2005, 08:30 PM
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:D
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.