| |
BGonline.org Forums
Math question: color of the confidence indicator
Posted By: maxim In Response To: Math question: color of the confidence indicator (eXtreme Gammon)
Date: Friday, 24 June 2011, at 6:38 a.m.
Xavier.
I just created a linear gradient from red to green in Photoshop, and it looks fine to me for the purpose of showing confidence.
One thing I changed is that I used L*a*b color space. In that space the gradient went from red to green goes through nice yellowish tone rather than through that dirty mix of green and red in the middle. So, if you transform the colors to Lab, mix the gradient and transform back to rgb you will get the same result. (I will send you the example by email soon.)
However I remember that for one of my projects I had to compress the middle of that range with 'sine' function: C = Math.sin(P * Math.PI / 2);
Another option is to use SMIL-interpolator, or any kind of symmetrical 'easing' (animation concept) but applied to color instead of time like exponential-in-out, quadratic-in-out, cubic-in-out etc, depending on the desired effect.
I can send you the code for lab tranformation, SMIL, easing etc, but you will have to convert from Java to C++ :)
| |
BGonline.org Forums is maintained by Stick with WebBBS 5.12.