chart-svg-0.2.0: Charting library targetting SVGs.
Safe HaskellNone
LanguageHaskell2010

Data.Colour

Description

Colour representations and combinations, based on https://hackage.haskell.org/package/Color

Synopsis

Documentation

data Colour Source #

Wrapper for Color.

Instances

Instances details
Eq Colour Source # 
Instance details

Defined in Data.Colour

Methods

(==) :: Colour -> Colour -> Bool #

(/=) :: Colour -> Colour -> Bool #

Show Colour Source # 
Instance details

Defined in Data.Colour

Generic Colour Source # 
Instance details

Defined in Data.Colour

Associated Types

type Rep Colour :: Type -> Type #

Methods

from :: Colour -> Rep Colour x #

to :: Rep Colour x -> Colour #

type Rep Colour Source # 
Instance details

Defined in Data.Colour

type Rep Colour = D1 ('MetaData "Colour" "Data.Colour" "chart-svg-0.2.0-92kmzNutfhz4Yaw4NJVLJs" 'True) (C1 ('MetaCons "Colour'" 'PrefixI 'True) (S1 ('MetaSel ('Just "color'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Color (Alpha RGB) Double))))

pattern Colour :: Double -> Double -> Double -> Double -> Colour Source #

Constructor pattern.

opac :: Colour -> Double Source #

get opacity

setOpac :: Double -> Colour -> Colour Source #

set opacity

palette :: [Color RGB Double] Source #

some RGB colors to work with

palette1 :: [Colour] Source #

some RGBA colors

blend :: Double -> Colour -> Colour -> Colour Source #

interpolate between 2 colors

blends :: Double -> [Colour] -> Colour Source #

interpolate across a list of Colours, with input being in Range 0 1

>>> blends 0 [black, (Colour 0.2 0.6 0.8 0.5), white] == black
True
>>> blends 1 [black, (Colour 0.2 0.6 0.8 0.5), white] == white
True
>>> blends 0.6 [black, (Colour 0.2 0.6 0.8 0.5), white]
RGBA 0.16 0.48 0.64 0.60

toHex :: Colour -> Text Source #

convert from Colour to #xxxxxx

grayscale :: Double -> Color RGB Double Source #

gray with 1 opacity

colorText :: Colour Source #

standard text color