Copyright | (c) Jann Müller 2018 |
---|---|
License | MIT |
Maintainer | Jann Müller <j.mueller.11@alumni.ucl.ac.uk> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Scales that assign colours to values.
Synopsis
- ordinalColours :: [a] -> ScaleOptions OrdinalColours a (Colour Double)
- data OrdinalColours a
- data Colour a
- data PaletteType
- paletteFor :: PaletteType -> Int -> [Colour Double]
- toCSSColour :: Colour Double -> String
Assign values to colours
ordinalColours :: [a] -> ScaleOptions OrdinalColours a (Colour Double) Source #
Create a scale that maps discrete values to colours. Colours will repeat if there are more than 12 different values.
data OrdinalColours a Source #
Instances
(Ord a, Eq a) => Scalable OrdinalColours a (Colour Double) Source # | |
Defined in Data.H3.Colour type Target OrdinalColours :: * -> * # type TargetRange OrdinalColours (Colour Double) :: * # data ScaleOptions OrdinalColours a (Colour Double) :: * # scale :: ScaleOptions OrdinalColours a (Colour Double) -> TargetRange OrdinalColours (Colour Double) -> a -> Target OrdinalColours (Colour Double) # | |
type Target OrdinalColours Source # | |
Defined in Data.H3.Colour | |
data ScaleOptions OrdinalColours a (Colour Double) Source # | |
Defined in Data.H3.Colour | |
type TargetRange OrdinalColours (Colour Double) Source # | |
Defined in Data.H3.Colour |
Utilities and re-exports
This type represents the human preception of colour.
The a
parameter is a numeric type used internally for the
representation.
The Monoid
instance allows one to add colours, but beware that adding
colours can take you out of gamut. Consider using blend
whenever
possible.
Instances
AffineSpace Colour | |
Defined in Data.Colour.Internal | |
ColourOps Colour | |
(Ord a, Eq a) => Scalable OrdinalColours a (Colour Double) # | |
Defined in Data.H3.Colour type Target OrdinalColours :: * -> * # type TargetRange OrdinalColours (Colour Double) :: * # data ScaleOptions OrdinalColours a (Colour Double) :: * # scale :: ScaleOptions OrdinalColours a (Colour Double) -> TargetRange OrdinalColours (Colour Double) -> a -> Target OrdinalColours (Colour Double) # | |
Eq a => Eq (Colour a) | |
Num a => Semigroup (Colour a) | |
Num a => Monoid (Colour a) | |
data ScaleOptions OrdinalColours a (Colour Double) # | |
Defined in Data.H3.Colour | |
type TargetRange OrdinalColours (Colour Double) # | |
Defined in Data.H3.Colour |
data PaletteType Source #
Instances
Eq PaletteType Source # | |
Defined in Data.H3.Colour (==) :: PaletteType -> PaletteType -> Bool # (/=) :: PaletteType -> PaletteType -> Bool # | |
Ord PaletteType Source # | |
Defined in Data.H3.Colour compare :: PaletteType -> PaletteType -> Ordering # (<) :: PaletteType -> PaletteType -> Bool # (<=) :: PaletteType -> PaletteType -> Bool # (>) :: PaletteType -> PaletteType -> Bool # (>=) :: PaletteType -> PaletteType -> Bool # max :: PaletteType -> PaletteType -> PaletteType # min :: PaletteType -> PaletteType -> PaletteType # | |
Show PaletteType Source # | |
Defined in Data.H3.Colour showsPrec :: Int -> PaletteType -> ShowS # show :: PaletteType -> String # showList :: [PaletteType] -> ShowS # | |
Generic PaletteType Source # | |
Defined in Data.H3.Colour type Rep PaletteType :: * -> * # from :: PaletteType -> Rep PaletteType x # to :: Rep PaletteType x -> PaletteType # | |
type Rep PaletteType Source # | |
Defined in Data.H3.Colour |
paletteFor :: PaletteType -> Int -> [Colour Double] Source #
Get a palette of the specified size for a palette type. The actual size of the palette may be smaller or larger than the argument.