PDA

Click to See Complete Forum and Search --> : What's the best way to do this?


Phobic
Dec 12th, 1999, 02:26 AM
Ok, so I have two colors, and I want to combine them by a certain percent ratio.

Lets say I have a red and blue, and I want the color that's 75% red and 25% blue.

I've got codes that appear to work at large ratios (like 50/50), but lets say when I try to combine 10% red and 90% white I get a blue shade.

The code I've been using to do this, broken down to make it a little simpler (so it's easier to get the idea!):

R1 = 255 * 0.1
G1 = 0 * 0.1
B1 = 0 * 0.1
R2 = 255 * 0.9
G2 = 255 * 0.9
B2 = 255 * 0.9
BackColor = RGB(R1 + R2, G1 + G2, B1 + B2)

And, once again, I get some shade of blue. Help? I'm not very good with colors!

Dec 12th, 1999, 02:56 AM
Your code gave me a light pink.

Phobic
Dec 12th, 1999, 03:01 AM
Well, I'm a little confused... better look at my first code...

Phobic
Dec 12th, 1999, 03:14 AM
Yeah, um, well appearently the code works, it's just something before it was messing it up. Heh, well... thanks VirtuallyVB for helping me see the light! :)