title: Color Mixing for more than 2 colors
body: <p>I'm trying to find an algorithm that will mix colors, based on a % amount.  I'm working on an election project, and want to be able to assign each candidate in a race a different color, and then create a "resulting" color based on how much of the vote that candidate has gotten.</p>
  
  <p>This question:</p>
  
  <p><a href="https://stackoverflow.com/q/1351442/1518211">Is there an algorithm for color mixing that works like mixing real colors?</a></p>
  
  <p>is close the question I'm asking - but potentially I need to be able to mix 3 or 4 or 5 colors together.  I understand that this ultimately an incredibly complicated question - but I'm curious what the suggested method is for doing this on more than 2 colors.  So, I might have:</p>
  
  <p>Red (40%), Green(10%), Blue (50%)</p>
  
  <p>OR</p>
  
  <p>Red (40%), Yellow (5%), Blue (10%), Orange (45%)</p>
  
  <p>Once again, I know that the last example would probably produce some sort of Gray or Brown or Black - and that's fine.  My problem is that I don't even have an algorithm that attempts to solve this problem.</p>
  
  <hr>
  
  <p>Edit:
  So - after posting this message, I realized that what I was really trying to accomplish was basically PAINT color mixing.  IN other words, I don't want LIGHT color mixing, I want to simulate what would happen with PAINT mixing - as that is the "predictable" result that I kept 'expecting' - and was having trouble getting.</p>
  
  <p>I found this link: <a href="http://painting.about.com/library/blpaint/blcolormixingpalette1.htm" rel="nofollow noreferrer">http://painting.about.com/library/blpaint/blcolormixingpalette1.htm</a></p>
  
  <p>which behaves VERY closely to what I'm trying to accomplish - and exposes a small "flaw" in my original idea.  What is demonstrates is that even though I can mix up to 6 colors using this algorithm, the actual "data" is always broken down into the 3 primary colors.</p>
  
  <p>Even so - this is very close.</p>
  
  <p>Thank you to everyone who has contributed to this thread - all of these suggestions have been very helpful in the exploration of this surprising complex question/field.</p>