Jump to content

Mixing RGB color values


silvercover

Recommended Posts

What do you mean by "mix all of them"?  You mean you want to come up with a color consisting of blending all those colors? Kind of a meaningless task since the outcome is probably going to be #ffffff anyway.  Think about it.  What if you took 50 buckets of paint and put them all in a vat.  What would it look like?

 

What way would you take 50 six digit numbers and mix them up?  Take a sum?  Or maybe take each in 2-digit pairs and average them to get some kind of approximation of the same color (r,g,b) ?

It's not going to be as easy as getting the average of the two colors.  You're going to have to convert to something like CMYK/HSL/HSV and so on, perform some extremely complex algorithms, and get a result that you would then convert back to RGB. (hex)

 

Your best bet, and easiest alternative without re-inventing the wheel is to find a jQuery plugin that can do it for you, such as this one

http://www.xarg.org/project/jquery-color-plugin-xcolor/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.