         if chroma.colors? and chroma.colors[hex]
             hex = chroma.colors[hex]
         else
-            throw "unknown color format: "+hex
+            throw "unknown color: "+hex
     if hex.length == 4 or hex.length == 7
         hex = hex.substr(1)
     if hex.length == 3

rgb2hex = () ->
    [r,g,b] = unpack arguments
    u = r << 16 | g << 8 | b
    str = "000000" + u.toString(16).toUpperCase()
    "#" + str.substr(str.length - 6)



        else
            throw "color mode "+m+" is not supported"

    darker: (amount=20) ->
        me = @
        lch = me.lch()
        lch[0] -= amount
        chroma.lch lch

    brighter: (amount=20) ->
        @darker -amount

    saturate: (amount=20) ->
        me = @
        lch = me.lch()
        lch[1] += amount
        chroma.lch lch

    desaturate: (amount=20) ->
        @saturate -amount



hex2rgb = (hex) ->
