title: Changing hue and lightness in Lab, Hcl or any perceptually uniform color system
body: <p>Changing hue, saturation and lightness in HSL color space if very easy.
  See <a href="https://github.com/harthur/color" rel="noreferrer">this javascript implementation for example</a>.</p>
  
  <p>It is also easy to generate color schemes like: analogous, monochromatic, triad, tetrad, etc.
  See <a href="http://bgrins.github.com/TinyColor/" rel="noreferrer">this javascript implementation</a>.</p>
  
  <p>The problem is that the HSL color system is not perceptually uniform.<br/>
  And actually that's a real problem. </p>
  
  <p>If you don't know what I am talking about, it's ok. 
  Read about it: <a href="http://boronine.com/2012/03/26/Color-Spaces-for-Human-Beings/" rel="noreferrer">here</a> and <a href="http://vis4.net/blog/posts/avoid-equidistant-hsv-colors/" rel="noreferrer">here</a>. (these two articles are really short but very valuable, you really should read them).</p>
  
  <p>The solution is using a color space that is perceptually uniform, like: CieLab, CieLuv, or Hcl.</p>
  
  <p>The problem is that these color spaces also have colors that are out of the gamut(colors that cannot be displayed).</p>
  
  <p>For working with different color spaces in javascript check out <a href="https://github.com/gka/chroma.js" rel="noreferrer">chroma.js</a> or <a href="https://github.com/jrus/chromatist" rel="noreferrer">chromatist</a>.</p>
  
  <p>After this little introduction here is my actual problem:</p>
  
  <p>I want to generate perceptually uniform color schemes(analogous, triad, tetrad, complementary, etc.). As I mentioned in Hsl it is simple: for example to generate a triad scheme I just rotate the HUE with 120 then with 240 and I have a triad scheme.</p>
  
  <p>Well, in CieLab, Hcl or CieLuv it is not that simple. In Hcl (Hue, Chroma, Lightness) if I rotate Hue with 120 grades without changing chroma and lightness it is possible that the generated color will be not displayable (will be outside of RGB space).</p>
  
  <p>Let's summarize the question:</p>
  
  <p><strong>How can I generate color schemes in a perceptually uniform color system (like CieLab, Hcl, CieLuv, or any other perceptually uniform color space)?</strong></p>
  
  <p>I want to implement this in javascript, but basically I want to find the method, so the question is language independent.</p>
  
  <p>I hope we can find a clever way together :)</p>