color mixing riddle
-
hi, my question is if i have 3 basic colors (each made of rgb): color1 : R:150, B:zero, G:255 color2 : R:255, B:150, G:zero color3 : R:zero, B:255, G:150 each of them can be mixed using the formula : new_color = floor(X*0.9)+floor(Y*0.1) X and Y can be abasic color or a new color allready created by using the formula. for example, if i want to mix color1 as main with color3 : new_color(R,B,G) = (floor(0.9*150)+floor(0.1*0) , floor(0.9*0)+floor(0.1*255) , floor(0.9*255)+floor(0.1*150) ) = (135, 25, 244). I need to find a way to mix the colors in order to get a desired color, for example : R:187 B:135 G:201. so far i wrote a "brute force" program which go all over the combinations of basic colors (runing for 7 days now...) hope there is a smarter way to solve the problem. Thanks.
-
hi, my question is if i have 3 basic colors (each made of rgb): color1 : R:150, B:zero, G:255 color2 : R:255, B:150, G:zero color3 : R:zero, B:255, G:150 each of them can be mixed using the formula : new_color = floor(X*0.9)+floor(Y*0.1) X and Y can be abasic color or a new color allready created by using the formula. for example, if i want to mix color1 as main with color3 : new_color(R,B,G) = (floor(0.9*150)+floor(0.1*0) , floor(0.9*0)+floor(0.1*255) , floor(0.9*255)+floor(0.1*150) ) = (135, 25, 244). I need to find a way to mix the colors in order to get a desired color, for example : R:187 B:135 G:201. so far i wrote a "brute force" program which go all over the combinations of basic colors (runing for 7 days now...) hope there is a smarter way to solve the problem. Thanks.
That's called linear equations. 150a+255b+0c=187 0a+150b+255c=135 255a+0b+150c=201
-
That's called linear equations. 150a+255b+0c=187 0a+150b+255c=135 255a+0b+150c=201
-
hi, my question is if i have 3 basic colors (each made of rgb): color1 : R:150, B:zero, G:255 color2 : R:255, B:150, G:zero color3 : R:zero, B:255, G:150 each of them can be mixed using the formula : new_color = floor(X*0.9)+floor(Y*0.1) X and Y can be abasic color or a new color allready created by using the formula. for example, if i want to mix color1 as main with color3 : new_color(R,B,G) = (floor(0.9*150)+floor(0.1*0) , floor(0.9*0)+floor(0.1*255) , floor(0.9*255)+floor(0.1*150) ) = (135, 25, 244). I need to find a way to mix the colors in order to get a desired color, for example : R:187 B:135 G:201. so far i wrote a "brute force" program which go all over the combinations of basic colors (runing for 7 days now...) hope there is a smarter way to solve the problem. Thanks.
Since you know the final RGB values that you need, what is the purpose of mixing other colours? Your question needs some clarification.
-
Since you know the final RGB values that you need, what is the purpose of mixing other colours? Your question needs some clarification.
first forgive my poor english, hope i can explain better now. It is a riddle spread out at my university. you have 3 basic colors (no other colors are available besides the basic colors and the ones produced by mixing the basic colors) and a machine which can mix them according to the formula i wrote. the target color is created by mixing the basic colors or their products in the machine. some colors take up to 1000 mixing steps so the way i try to "solve" it can take forever. i dont know much about solving such problems so i ask for help here. thanks.
-
first forgive my poor english, hope i can explain better now. It is a riddle spread out at my university. you have 3 basic colors (no other colors are available besides the basic colors and the ones produced by mixing the basic colors) and a machine which can mix them according to the formula i wrote. the target color is created by mixing the basic colors or their products in the machine. some colors take up to 1000 mixing steps so the way i try to "solve" it can take forever. i dont know much about solving such problems so i ask for help here. thanks.
Kobi_Z wrote:
It is a riddle spread out at my university.
That makes it clear. However, this being primarily a technical programming forum, I'm not sure if you have come to the right place.
-
Kobi_Z wrote:
It is a riddle spread out at my university.
That makes it clear. However, this being primarily a technical programming forum, I'm not sure if you have come to the right place.
-
hi, my question is if i have 3 basic colors (each made of rgb): color1 : R:150, B:zero, G:255 color2 : R:255, B:150, G:zero color3 : R:zero, B:255, G:150 each of them can be mixed using the formula : new_color = floor(X*0.9)+floor(Y*0.1) X and Y can be abasic color or a new color allready created by using the formula. for example, if i want to mix color1 as main with color3 : new_color(R,B,G) = (floor(0.9*150)+floor(0.1*0) , floor(0.9*0)+floor(0.1*255) , floor(0.9*255)+floor(0.1*150) ) = (135, 25, 244). I need to find a way to mix the colors in order to get a desired color, for example : R:187 B:135 G:201. so far i wrote a "brute force" program which go all over the combinations of basic colors (runing for 7 days now...) hope there is a smarter way to solve the problem. Thanks.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
-
any suggestions where i can ask ? on math forum i was told to go to programmers forum... thanks.
Sorry, no idea.
-
by solving this equation i get an answer : X = 0.6077 Y = 0.3759 Z = 0.307 That give me nothing... Im talking about mixing many basic colors in order to get one special, i need to find the mixing sequence.
At that point, the problem is half-solved. Next step would be to find how to get there... One way, would be to mix Y and Z (and any resulting color) until you get the proper ratio by using the best 2 candidate colors that consist of Y and Z or their mix. Once you have done that, you repeat same process with that mix and X. The ratio for Y and Z alone would be 0.55 and 0.45. 1) 0.9Y + 0.1Z --> Mix 1 2) 0.9 M1 + 0.1Z --> Mix 2 --> 0.81Y + 0.19Z 3) 0.9 M2 + 0.1Z --> Mix 3 --> 0.72Y + 0.28Z ... 6) --> 0.53Y + 0.47Z At that point, you would take 0.9 of that and 0.1 of Mix 3... and you get 0.549 of Y. If you need more precision, you can do more mix...
Philippe Mori