Copyright | (c) Ivan Lazar Miljenovic |
---|---|
License | 3-Clause BSD-style |
Maintainer | Ivan.Miljenovic@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
This module defines the various colors, etc. for Graphviz. For information on colors in general, see: http://graphviz.org/doc/info/attrs.html#k:color For named colors, see: http://graphviz.org/doc/info/colors.html
Note that the ColorBrewer Color Schemes (shortened to just "Brewer" for the rest of this module) are covered by the following license (also available in the LICENSE file of this library): http://graphviz.org/doc/info/colors.html#brewer_license
Synopsis
- data ColorScheme
- = X11
- | SVG
- | Brewer BrewerScheme
- data Color
- type ColorList = [WeightedColor]
- data WeightedColor = WC {}
- toWC :: Color -> WeightedColor
- toColorList :: [Color] -> ColorList
- class NamedColor nc where
- toWColor :: NamedColor nc => nc -> WeightedColor
- toColour :: Color -> Maybe (AlphaColour Double)
- fromColour :: Colour Double -> Color
- fromAColour :: AlphaColour Double -> Color
Color schemes.
data ColorScheme Source #
This represents the color schemes that Graphviz accepts.
Instances
Colors
Defining a color for use with Graphviz. Note that named colors
have been split up into Color
s and those based upon the
Brewer color schemes.
RGB | |
RGBA | |
HSV | The |
X11Color X11Color | |
SVGColor SVGColor | |
BrewerColor BrewerColor |
type ColorList = [WeightedColor] Source #
The sum of the optional weightings must sum to at most 1
.
data WeightedColor Source #
A Color
tagged with an optional weighting.
Instances
toWC :: Color -> WeightedColor Source #
For colors without weightings.
toColorList :: [Color] -> ColorList Source #
For a list of colors without weightings.
class NamedColor nc where Source #
More easily convert named colors to an overall Color
value.
colorScheme, toColor, printNC, parseNC'
Instances
NamedColor X11Color Source # | |
NamedColor SVGColor Source # | |
NamedColor BrewerColor Source # | |
Defined in Data.GraphViz.Attributes.Colors colorScheme :: BrewerColor -> ColorScheme toColor :: BrewerColor -> Color Source # printNC :: Bool -> BrewerColor -> DotCode parseNC' :: Bool -> Parse BrewerColor |
toWColor :: NamedColor nc => nc -> WeightedColor Source #
Conversion to/from Colour
.
fromAColour :: AlphaColour Double -> Color Source #
Convert an AlphaColour
to an RGBA
Color
. The exception to
this is for any AlphaColour
which has alphaChannel ac == 0
;
these are converted to X11Color
(note that the
Transparent
Show
instance for such an AlphaColour
is "transparent"
).