Colour
From HaskellWiki
This page provides a short introduction to using the colour package on hackage.
1 The Colour data type
TheColour DoubleYou may wish to make a type synonym for this type in your program if you will use it everywhere.
You can always use the2 Creating colours
A collections of colours given by name can be found in thesRGB24 red green blue
will create the colour with those sRGB colour coordinates.
If you have threesRGB red green blue
3 Manipulating Colours
The colour operations are found in thethe function
blend 0.25 red greenwill create a new colour that is 25% red, and 75% green. The weight parameter (the first parameter) should be between 0 and 1, otherwise an out of gamut colour could result.
If you need to blend more than two colours, you can use multiple applications ofaffineCombo [(0.25,red),(0.5,green)] violet
will create a new colour that is 25% red, 50% green, and 25% violet. Again the weights should all be non-negative and the sum of the weights should be no more than 1, otherwise an out of gamut colour could result.
Color intensity can be changed by usingdarken 0.4 turquoisewill produce a turquoise that is only 40% of the intensity of normal turquoise. The weight parameter (the first parameter) should be between 0 and 1, otherwise an out of gamut colour could result. However if you know that the intensity is low enough, you may safe "darken" by values greater than 1 (which will actually lighten the colour).
Lastly, colours are instance of a