Safe Haskell | None |
---|---|
Language | Haskell2010 |
Colour representations and combinations, based on https://hackage.haskell.org/package/Color
Synopsis
- data Colour
- pattern Colour :: Double -> Double -> Double -> Double -> Colour
- opac :: Colour -> Double
- setOpac :: Double -> Colour -> Colour
- fromRGB :: Color RGB Double -> Double -> Colour
- hex :: Colour -> Text
- palette :: [Color RGB Double]
- palette1 :: [Colour]
- blend :: Double -> Colour -> Colour -> Colour
- blends :: Double -> [Colour] -> Colour
- toHex :: Colour -> Text
- fromHex :: Text -> Either Text (Color RGB Double)
- unsafeFromHex :: Text -> Color RGB Double
- grayscale :: Double -> Color RGB Double
- colorText :: Colour
- transparent :: Colour
- black :: Colour
- white :: Colour
Documentation
Wrapper for Color
.
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
transparent :: Colour Source #