Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/10/10 06:33
Read: times


 
#176579 - You don't have paletted device so stop thinking about index
Responding to: ???'s previous message
How do you get from black to white? Magic index 0..124? Or simply increasing the red, green and blue channels at the same time until reaching the intensity level you want?

How to you get black to red? Magic index 0..124? Or simply increasing the red channel 0, 1, 2, 3, 4 while keeping green and blue at zero?

How do you get black to blue?

...

As long as you lock yourself into thinking about some magic index 0..124 you will stumble into problem after problem after problem after problem. Do not think of an index. Think about percentages of red, green and blue. That is all that matters. An index is only meaningful if you have a paletted device - a device that can show a small number of colors at the same time, but can select these colors from a much larger set. You can at any time select any color from the full color resolution you have available. For that reason, a palette will not make sense. Just work with target color as RGB triplet. Using another color space helps when compute in-between colors, but in the end you still need to convert to RGB since your hardware controls RGB hardware.

Look at that video again. Look at the edges of a color circle. What do you think it would look like if you ignore your 0..124 index and just walk around on the border of that color circle? Guess what - it would look very much like the linked video. The biggest difference is that the video shows that they are also walking towards the center of the color circle, allowing them to get smooth toning from cyan or maybe magenta and animating towards white. How to go from black to any color? Just start at the apex of the HSV cone and walk towards any point of the base of the cone. The video claims that they have defined 16 colors. The colors are located somewhere in the color space and they are pseudo-randomly or sequentially selecting one of these 16 colors as new target color. They then compute in-between colors to smoothly transform from one clor to another. No index involved somewhere. Just in-between computations. The results will vary if you use RGB or HSV color space or if you use any of the other, less common, color spaces.

The conversion formulas to go from HSV values into RGB values is trivial, and the HSV values allows you to perform all the animation you want by just slowly changing one or two of the parameters. If you do read the page, you'll see the formulas. It's very easy to convert from floating point formulas into integer formulas. And it is also easy to either tabulate sin and/or cos for the angle around the cone. But you can also "cheat" and see the cone as having 6 sides instead of being round. Then it's enough to know which of the 6 pizza slices you are inside. The approximation with a six-sided pyramid will still give excellent color transitions.

Sample code? Huge amounts available on the net.

List of 120 messages in thread
TopicAuthorDate
IRF640 noob test            01/01/70 00:00      
   Gate current            01/01/70 00:00      
   "empirical" learning...            01/01/70 00:00      
      read the material...            01/01/70 00:00      
         I believe he is using a MOSFET here            01/01/70 00:00      
            kit            01/01/70 00:00      
               It is DC output            01/01/70 00:00      
               POOF BOOM            01/01/70 00:00      
   what about this circuit?            01/01/70 00:00      
   IRFZ48N and a circuit, this one can fit?            01/01/70 00:00      
      A little bit easier link            01/01/70 00:00      
         Thanks Per            01/01/70 00:00      
            The longest road from a to b            01/01/70 00:00      
               The problem is...            01/01/70 00:00      
                  Sorry            01/01/70 00:00      
                     Hope, you will find the time...            01/01/70 00:00      
                        RGB Controller            01/01/70 00:00      
                           do you need it that bright            01/01/70 00:00      
                              Bar and some info            01/01/70 00:00      
                                 sure you can            01/01/70 00:00      
                                    Hard to adjust intensity by changing voltage            01/01/70 00:00      
                           Simple scheme...            01/01/70 00:00      
                              Very nice!            01/01/70 00:00      
                                 HC32 and not KTC32            01/01/70 00:00      
                                 Answers...            01/01/70 00:00      
                                    maybe another CI?            01/01/70 00:00      
                                       Yes most hc is ok            01/01/70 00:00      
                                          Same HCs to switch ULN2803?            01/01/70 00:00      
                                       Logic Level MOSFET            01/01/70 00:00      
                     you can - wth a caveat            01/01/70 00:00      
   Can I ask a color question?            01/01/70 00:00      
      Start a new thread            01/01/70 00:00      
         Interpolate in RGB or HSV but not in your tabulated index.            01/01/70 00:00      
            linear interpolations...            01/01/70 00:00      
               Standard interpolation            01/01/70 00:00      
                  that depends            01/01/70 00:00      
         right subject            01/01/70 00:00      
      your premises are wrong            01/01/70 00:00      
      If you answer a question...            01/01/70 00:00      
         Just tests, no MOSFETs yet...            01/01/70 00:00      
            The ULN2803 will ruin your colors!            01/01/70 00:00      
               when doing color            01/01/70 00:00      
               miss the point... the point is the color generation...            01/01/70 00:00      
                  Help with what?            01/01/70 00:00      
                  already answered            01/01/70 00:00      
                  Have you seen my link?            01/01/70 00:00      
                     Yes, but dont helps...            01/01/70 00:00      
                        as usual            01/01/70 00:00      
                           not "SPECIFIC, SPECIFIC, SPECIFIC"            01/01/70 00:00      
                              Use another look-up table...            01/01/70 00:00      
                                 Thats it!            01/01/70 00:00      
                                    Copy from a professional solution...            01/01/70 00:00      
                                       Youtube has some nice videos...            01/01/70 00:00      
                              you've got it wrong and what are you doing            01/01/70 00:00      
                                 I care Erik!            01/01/70 00:00      
                                    why are you "going through steps"?            01/01/70 00:00      
                                       Kai videos?            01/01/70 00:00      
                                          Already been told            01/01/70 00:00      
                                             HSV            01/01/70 00:00      
                                                Now I'm confused            01/01/70 00:00      
                                                   Still never telling what you do want            01/01/70 00:00      
                                                      you are going for an intensity ratio ...            01/01/70 00:00      
                                                      I see no contradiction...            01/01/70 00:00      
                                                         I think it was incrementing of the index that was the proble            01/01/70 00:00      
                                                            Chico, are you getting it            01/01/70 00:00      
                                                               Words            01/01/70 00:00      
                                                                  He should have enough information now...            01/01/70 00:00      
                                                                     that is often the problem ...            01/01/70 00:00      
                                                                        Words fail me...            01/01/70 00:00      
                                                                  How to add            01/01/70 00:00      
                                                                     You don't have paletted device so stop thinking about index            01/01/70 00:00      
                                                                        only 125 colors            01/01/70 00:00      
                                                                           Smooth? Sudden? This make no sense!            01/01/70 00:00      
                                                                              I'm tired from guessing, Chico...            01/01/70 00:00      
                                                                           So you haven't read what we have posted?            01/01/70 00:00      
                                                         Thats it Kai...            01/01/70 00:00      
                                                            place my 125 unchangeable colors in a nice sequence in this            01/01/70 00:00      
                                                               Lacks words for me!            01/01/70 00:00      
                                                                  You need more levels.            01/01/70 00:00      
                                                                  See previous suggestions!            01/01/70 00:00      
                                                            only 32 words            01/01/70 00:00      
                                                            what is "nice sequence"? and for what purpose?            01/01/70 00:00      
                                                            A Color Sequence            01/01/70 00:00      
                                                               Gives color jumps            01/01/70 00:00      
                                                                  Missing backslash in previous post            01/01/70 00:00      
                                                                  Look at the example cited earlier            01/01/70 00:00      
                                                                     not a good one            01/01/70 00:00      
                                                                        Starting point?            01/01/70 00:00      
                                                                           my thought is            01/01/70 00:00      
                                                                              Did I get you?            01/01/70 00:00      
                                                                                 sort of            01/01/70 00:00      
                                                                                    Thanks!            01/01/70 00:00      
                                                                                    You are so full of yourself...            01/01/70 00:00      
                                                                                       "web safe" colors available in standard VGA color palette            01/01/70 00:00      
                                                                                          right, you compensate for this by ...            01/01/70 00:00      
                                                                                             Note that candela hides the eyes spectral response            01/01/70 00:00      
                                                                                                true, and            01/01/70 00:00      
                                                                                                   But he doesn't want his solution to be better - just differe            01/01/70 00:00      
                                                                                                      I give up suggesting better and simpler ...            01/01/70 00:00      
                                                                                       with "binary weighing" he gets 32738 colors            01/01/70 00:00      
                                                                                          Number of colors            01/01/70 00:00      
                                                                                             for a LED sign: none            01/01/70 00:00      
                                                                                             Solve modulation first, then bother about constant-intensity            01/01/70 00:00      
                                                                                                not if you do as I suggested            01/01/70 00:00      
                                                                                                   You'll see a lot if slow-stepping changes            01/01/70 00:00      
                                                                                       How naive I was...            01/01/70 00:00      
                                                                                          I do not know, but ...            01/01/70 00:00      
                                                                                             I still say...            01/01/70 00:00      
                                                                                          Everything depends on needs - simplification often ok            01/01/70 00:00      
                                                                                             Gamma            01/01/70 00:00      
                                                                                             If I were Chico...            01/01/70 00:00      
                                                                     Another Color Sequence...            01/01/70 00:00      
                                                                        Yet another sequence...            01/01/70 00:00      
                                                                           another (better) approach            01/01/70 00:00      
                                                               Oops....Sawtooth File Deleted            01/01/70 00:00      
                                                                  On its way...            01/01/70 00:00      
                                                                     Received and RePosted            01/01/70 00:00      
                                                                        RE: wake up the cat            01/01/70 00:00      
                                                                           Walking the RGB cube as described earlier            01/01/70 00:00      
                                                                              the way to do it            01/01/70 00:00      

Back to Subject List