view may/plot/colour.yeti @ 338:0a856c4d5338

Rename YetiLab -> May throughout
author Chris Cannam
date Tue, 11 Jun 2013 22:22:25 +0100
parents yetilab/plot/colour.yeti@4bce024b3cc6
children
line wrap: on
line source
module may.plot.colour;

import org.jzy3d.colors: Color;

distinctColours = array [
    { r = 82,  g = 126, b = 154 }, // dark steel blue
    { r = 161, g = 54,  b = 2   }, // red
    { r = 207, g = 228, b = 148 }, // grey-green
    { r = 21,  g = 183, b = 197 }, // light blue
    { r = 251, g = 116, b = 43  }, // light red
    { r = 200, g = 125, b = 234 }, // light purple
    { r = 126, g = 33,  b = 28  }, // dried blood!
    { r = 188, g = 13,  b = 207 }, // mid purple
];    

distinctColour n =
    if n < 0
    then distinctColour (-n)
    else
        rgb = distinctColours[n % (length distinctColours)];
        new Color(rgb.r / 255.0, rgb.g / 255.0, rgb.b / 255.0);
    fi;

{
    distinctColour
};