Clay.Color

clay-0.15.0: CSS preprocessor as embedded Haskell.

Safe Haskell | None
Language | Haskell2010

Clay.Color

Contents

- Color datatype.
- Color constructors.
- Setting individual color components.
- Color conversions.
- Computing with colors.
- List of color values by name.

Synopsis

- data Color
  - = Rgba Integer Integer Integer Float
  - | Hsla Integer Float Float Float
  - | Other Value
- rgba :: Integer -> Integer -> Integer -> Float -> Color
- rgb :: Integer -> Integer -> Integer -> Color
- hsla :: Integer -> Float -> Float -> Float -> Color
- hsl :: Integer -> Float -> Float -> Color
- grayish :: Integer -> Color
- transparent :: Color
- setR :: Integer -> Color -> Color
- setG :: Integer -> Color -> Color
- setB :: Integer -> Color -> Color
- setA :: Float -> Color -> Color
- toRgba :: Color -> Color
- toHsla :: Color -> Color
- (*.) :: Color -> Integer -> Color
- (+.) :: Color -> Integer -> Color
- (-.) :: Color -> Integer -> Color
- clamp :: (Ord a, Num a) => a -> a
- lighten :: Float -> Color -> Color
- darken :: Float -> Color -> Color
- lerp :: Float -> Color -> Color -> Color
- parse :: Text -> Color
- aliceblue :: Color
- antiquewhite :: Color
- aqua :: Color
- aquamarine :: Color
- azure :: Color
- beige :: Color
- bisque :: Color
- black :: Color
- blanchedalmond :: Color
- blue :: Color
- blueviolet :: Color
- brown :: Color
- burlywood :: Color
- cadetblue :: Color
- chartreuse :: Color
- chocolate :: Color
- coral :: Color
- cornflowerblue :: Color
- cornsilk :: Color
- crimson :: Color
- cyan :: Color
- darkblue :: Color
- darkcyan :: Color
- darkgoldenrod :: Color
- darkgray :: Color
- darkgreen :: Color
- darkgrey :: Color
- darkkhaki :: Color
- darkmagenta :: Color
- darkolivegreen :: Color
- darkorange :: Color
- darkorchid :: Color
- darkred :: Color
- darksalmon :: Color
- darkseagreen :: Color
- darkslateblue :: Color
- darkslategray :: Color
- darkslategrey :: Color
- darkturquoise :: Color
- darkviolet :: Color
- deeppink :: Color
- deepskyblue :: Color
- dimgray :: Color
- dimgrey :: Color
- dodgerblue :: Color
- firebrick :: Color
- floralwhite :: Color
- forestgreen :: Color
- fuchsia :: Color
- gainsboro :: Color
- ghostwhite :: Color
- gold :: Color
- goldenrod :: Color
- gray :: Color
- green :: Color
- greenyellow :: Color
- grey :: Color
- honeydew :: Color
- hotpink :: Color
- indianred :: Color
- indigo :: Color
- ivory :: Color
- khaki :: Color
- lavender :: Color
- lavenderblush :: Color
- lawngreen :: Color
- lemonchiffon :: Color
- lightblue :: Color
- lightcoral :: Color
- lightcyan :: Color
- lightgoldenrodyellow :: Color
- lightgray :: Color
- lightgreen :: Color
- lightgrey :: Color
- lightpink :: Color
- lightsalmon :: Color
- lightseagreen :: Color
- lightskyblue :: Color
- lightslategray :: Color
- lightslategrey :: Color
- lightsteelblue :: Color
- lightyellow :: Color
- lime :: Color
- limegreen :: Color
- linen :: Color
- magenta :: Color
- maroon :: Color
- mediumaquamarine :: Color
- mediumblue :: Color
- mediumorchid :: Color
- mediumpurple :: Color
- mediumseagreen :: Color
- mediumslateblue :: Color
- mediumspringgreen :: Color
- mediumturquoise :: Color
- mediumvioletred :: Color
- midnightblue :: Color
- mintcream :: Color
- mistyrose :: Color
- moccasin :: Color
- navajowhite :: Color
- navy :: Color
- oldlace :: Color
- olive :: Color
- olivedrab :: Color
- orange :: Color
- orangered :: Color
- orchid :: Color
- palegoldenrod :: Color
- palegreen :: Color
- paleturquoise :: Color
- palevioletred :: Color
- papayawhip :: Color
- peachpuff :: Color
- peru :: Color
- pink :: Color
- plum :: Color
- powderblue :: Color
- purple :: Color
- red :: Color
- rosybrown :: Color
- royalblue :: Color
- saddlebrown :: Color
- salmon :: Color
- sandybrown :: Color
- seagreen :: Color
- seashell :: Color
- sienna :: Color
- silver :: Color
- skyblue :: Color
- slateblue :: Color
- slategray :: Color
- slategrey :: Color
- snow :: Color
- springgreen :: Color
- steelblue :: Color
- tan :: Color
- teal :: Color
- thistle :: Color
- tomato :: Color
- turquoise :: Color
- violet :: Color
- wheat :: Color
- white :: Color
- whitesmoke :: Color
- yellow :: Color
- yellowgreen :: Color

# Color datatype.

data Color #

Constructors

Rgba Integer Integer Integer Float |
Hsla Integer Float Float Float |
Other Value |

#### Instances

Instances details

Background Color # |
Instance details Defined in Clay.Background Methods background :: Color -> Css #
Auto Color # |
Instance details Defined in Clay.Color Methods auto :: Color #
Inherit Color # |
Instance details Defined in Clay.Color Methods inherit :: Color #
None Color # |
Instance details Defined in Clay.Color Methods none :: Color #
Other Color # |
Instance details Defined in Clay.Color Methods other :: Value -> Color #
Val Color # |
Instance details Defined in Clay.Color Methods value :: Color -> Value #
IsString Color # |
Instance details Defined in Clay.Color Methods fromString :: String -> Color #
Show Color # |
Instance details Defined in Clay.Color Methods showsPrec :: Int -> Color -> ShowS # show :: Color -> String # showList :: [Color] -> ShowS #
Eq Color # |
Instance details Defined in Clay.Color Methods (==) :: Color -> Color -> Bool # (/=) :: Color -> Color -> Bool #

# Color constructors.

rgba :: Integer -> Integer -> Integer -> Float -> Color #

rgb :: Integer -> Integer -> Integer -> Color #

hsla :: Integer -> Float -> Float -> Float -> Color #

hsl :: Integer -> Float -> Float -> Color #

grayish :: Integer -> Color #

transparent :: Color #

# Setting individual color components.

setR :: Integer -> Color -> Color #

setG :: Integer -> Color -> Color #

setB :: Integer -> Color -> Color #

setA :: Float -> Color -> Color #

# Color conversions.

toRgba :: Color -> Color #

toHsla :: Color -> Color #

# Computing with colors.

(*.) :: Color -> Integer -> Color infixl 7 #

(+.) :: Color -> Integer -> Color infixl 6 #

(-.) :: Color -> Integer -> Color infixl 6 #

clamp :: (Ord a, Num a) => a -> a #

lighten :: Float -> Color -> Color #

darken :: Float -> Color -> Color #

lerp :: Float -> Color -> Color -> Color #

parse :: Text -> Color #

# List of color values by name.

aliceblue :: Color #

antiquewhite :: Color #

aqua :: Color #

aquamarine :: Color #

azure :: Color #

beige :: Color #

bisque :: Color #

black :: Color #

blanchedalmond :: Color #

blue :: Color #

blueviolet :: Color #

brown :: Color #

burlywood :: Color #

cadetblue :: Color #

chartreuse :: Color #

chocolate :: Color #

coral :: Color #

cornflowerblue :: Color #

cornsilk :: Color #

crimson :: Color #

cyan :: Color #

darkblue :: Color #

darkcyan :: Color #

darkgoldenrod :: Color #

darkgray :: Color #

darkgreen :: Color #

darkgrey :: Color #

darkkhaki :: Color #

darkmagenta :: Color #

darkolivegreen :: Color #

darkorange :: Color #

darkorchid :: Color #

darkred :: Color #

darksalmon :: Color #

darkseagreen :: Color #

darkslateblue :: Color #

darkslategray :: Color #

darkslategrey :: Color #

darkturquoise :: Color #

darkviolet :: Color #

deeppink :: Color #

deepskyblue :: Color #

dimgray :: Color #

dimgrey :: Color #

dodgerblue :: Color #

firebrick :: Color #

floralwhite :: Color #

forestgreen :: Color #

fuchsia :: Color #

gainsboro :: Color #

ghostwhite :: Color #

gold :: Color #

goldenrod :: Color #

gray :: Color #

green :: Color #

greenyellow :: Color #

grey :: Color #

honeydew :: Color #

hotpink :: Color #

indianred :: Color #

indigo :: Color #

ivory :: Color #

khaki :: Color #

lavender :: Color #

lavenderblush :: Color #

lawngreen :: Color #

lemonchiffon :: Color #

lightblue :: Color #

lightcoral :: Color #

lightcyan :: Color #

lightgoldenrodyellow :: Color #

lightgray :: Color #

lightgreen :: Color #

lightgrey :: Color #

lightpink :: Color #

lightsalmon :: Color #

lightseagreen :: Color #

lightskyblue :: Color #

lightslategray :: Color #

lightslategrey :: Color #

lightsteelblue :: Color #

lightyellow :: Color #

lime :: Color #

limegreen :: Color #

linen :: Color #

magenta :: Color #

maroon :: Color #

mediumaquamarine :: Color #

mediumblue :: Color #

mediumorchid :: Color #

mediumpurple :: Color #

mediumseagreen :: Color #

mediumslateblue :: Color #

mediumspringgreen :: Color #

mediumturquoise :: Color #

mediumvioletred :: Color #

midnightblue :: Color #

mintcream :: Color #

mistyrose :: Color #

moccasin :: Color #

navajowhite :: Color #

navy :: Color #

oldlace :: Color #

olive :: Color #

olivedrab :: Color #

orange :: Color #

orangered :: Color #

orchid :: Color #

palegoldenrod :: Color #

palegreen :: Color #

paleturquoise :: Color #

palevioletred :: Color #

papayawhip :: Color #

peachpuff :: Color #

peru :: Color #

pink :: Color #

plum :: Color #

powderblue :: Color #

purple :: Color #

red :: Color #

rosybrown :: Color #

royalblue :: Color #

saddlebrown :: Color #

salmon :: Color #

sandybrown :: Color #

seagreen :: Color #

seashell :: Color #

sienna :: Color #

silver :: Color #

skyblue :: Color #

slateblue :: Color #

slategray :: Color #

slategrey :: Color #

snow :: Color #

springgreen :: Color #

steelblue :: Color #

tan :: Color #

teal :: Color #

thistle :: Color #

tomato :: Color #

turquoise :: Color #

violet :: Color #

wheat :: Color #

white :: Color #

whitesmoke :: Color #

yellow :: Color #

yellowgreen :: Color #