Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. color mixing riddle

color mixing riddle

Scheduled Pinned Locked Moved Design and Architecture
helptutorialquestion
10 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kobi_Z
    wrote on last edited by
    #1

    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.

    B L R 3 Replies Last reply
    0
    • K Kobi_Z

      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.

      B Offline
      B Offline
      Bernhard Hiller
      wrote on last edited by
      #2

      That's called linear equations. 150a+255b+0c=187 0a+150b+255c=135 255a+0b+150c=201

      K 1 Reply Last reply
      0
      • B Bernhard Hiller

        That's called linear equations. 150a+255b+0c=187 0a+150b+255c=135 255a+0b+150c=201

        K Offline
        K Offline
        Kobi_Z
        wrote on last edited by
        #3

        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.

        P 1 Reply Last reply
        0
        • K Kobi_Z

          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.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Since you know the final RGB values that you need, what is the purpose of mixing other colours? Your question needs some clarification.

          speaking as ...

          K 1 Reply Last reply
          0
          • L Lost User

            Since you know the final RGB values that you need, what is the purpose of mixing other colours? Your question needs some clarification.

            speaking as ...

            K Offline
            K Offline
            Kobi_Z
            wrote on last edited by
            #5

            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.

            L 1 Reply Last reply
            0
            • K Kobi_Z

              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.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              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.

              speaking as ...

              K 1 Reply Last reply
              0
              • L Lost User

                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.

                speaking as ...

                K Offline
                K Offline
                Kobi_Z
                wrote on last edited by
                #7

                any suggestions where i can ask ? on math forum i was told to go to programmers forum... thanks.

                L 1 Reply Last reply
                0
                • K Kobi_Z

                  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.

                  R Offline
                  R Offline
                  R Giskard Reventlov
                  wrote on last edited by
                  #8

                  This[^] might help.

                  "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

                  1 Reply Last reply
                  0
                  • K Kobi_Z

                    any suggestions where i can ask ? on math forum i was told to go to programmers forum... thanks.

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Sorry, no idea.

                    speaking as ...

                    1 Reply Last reply
                    0
                    • K Kobi_Z

                      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.

                      P Offline
                      P Offline
                      Philippe Mori
                      wrote on last edited by
                      #10

                      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

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups