Note that there are some explanatory texts on larger screens.

plurals
  1. POValue as colour representation
    text
    copied!<p>Converting a value to a colour is well known, I do understand the following two approaches (very well described in <a href="https://stackoverflow.com/questions/1423925/changing-rgb-color-values-to-represent-a-value">changing rgb color values to represent a value</a>)</p> <ol> <li>Value as shades of grey</li> <li><a href="https://stackoverflow.com/questions/1423925/changing-rgb-color-values-to-represent-a-value/1423995#1423995">Value as brightness of a base colour</a> (e.g. <a href="http://farm3.static.flickr.com/2614/3921280034_d6328ec188_o.png" rel="nofollow noreferrer">brightness of blue</a>)</li> </ol> <p>But what is the best algorithm when I want to use the full colour range ("all colours"). When I use "greys" with 8bit RGB values, I actually do have a representation of 256 shades (white to black). But if I use the whole range, I could use more shades. Something like <a href="http://2.bp.blogspot.com/-FjYXzWE-Pw8/TlVYWfYNwQI/AAAAAAAAAiU/abI9dL94DM0/s1600/9924637-large.gif" rel="nofollow noreferrer">this</a>. Also this would be easier to recognize.</p> <p>Basically I need the algorithm in Javascript, but I guess all code such as C#, Java, pseudo code would do as well. The legend at the bottom shows the encoding, and I am looking for the algorithm for this.</p> <p>So having a range of values(e.g. 1-1000), I could represent 1 as white and 1000 as black, but I could also represent 1 as yellow and 1000 as blue. But is there a standard algorithm for this? Looking at the example <a href="http://2.bp.blogspot.com/-FjYXzWE-Pw8/TlVYWfYNwQI/AAAAAAAAAiU/abI9dL94DM0/s1600/9924637-large.gif" rel="nofollow noreferrer">here</a>, it is shown that they use colour intervals. I do not only want to use greys or change the brightness, but use all colours.</p> <p>This is a <a href="http://colorbrewer2.org/" rel="nofollow noreferrer">visual demonstration</a> (Flash required). Given values a represented in a color scheme, my goal is to calculate the colours.</p> <p>I do have a linear colour range, e.g. from 1-30000 </p> <p>-- Update --</p> <p><a href="https://stackoverflow.com/questions/649454/what-is-the-best-way-to-average-two-colors-that-define-a-linear-gradient">Here</a> I found that here is something called a LabSpace:</p> <blockquote> <p>Lab space is a way of representing colours where points that are close to each other are those that look similar to each other to humans.</p> </blockquote> <p>So what I would need is an algorithm to represent the linear values in this lab space.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload