Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mixing Colors

Status
Not open for further replies.

vtops

IS-IT--Management
Oct 13, 2005
63
GR
Dear All,

1. How Can Produce a color which it consisting of some other colors.
I Have an application which user is declaring some colors with the help of the Red,Green and Blue attributes.

After that he must see the result color which is the mixing of the above colors he has declared.


2. Is it possible to giving a "quantity" of the colors which he has declared and see the Result color.

For Example:

I Have a color col1 With Attributes(Red=120,Green=200,Blue=150)
Also Another One col2 with (Red=50,Green=200,Blue=35)

I Want a final Color Which it wiil be final=col1*0,2+col2*0,41

Thanks A lot
And Best Regards
 
System.Drawing.Color mycolor = System.Drawing.Color.FromArgb(red,green,blue);
 
Thanks JurkMonkey for your interesting.

But my problem is not how will i declare the color with the RGB properties but how can i mix colors which i have declared with RGB.

For Example:

Color col1,col2,final_col;

col1=Color.FromArgb(130,180,100);
col2=Color.FromArgb(100,120,200);

1. What Color will be produced from the above?

2. What Color will be produced i declare that i want

30% from col1 and 55% from col2

Is there any sample code to simulate that?

Thanks a lot
 
set your alpha level

Color.FromArgb(alpha, red, green, blue)

Your alpha is the transparency %. If you overlay the colors you will see the result as a negative color addition. It's like paint rather than light. When you mix enough red green and blue together in paint, you get black, where as with light, if you mix red green and blue you get white.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top