gren-color

A standard Color type allowing packages that produce or consume colors to easily interoperate.

This project is a Gren port of avh4/elm-color.

Example

import Color exposing ( Color )
import Html exposing ( Html )
import Html.Attributes exposing ( style )


view : Color -> Html msg
view foreground =
    let
        hue = ( Color.toHsla foreground ).hue
        borderColor = Color.hsla hue 0.75 0.5 0.8
    in
        Html.div
            [ style "background-color" ( Color.toCssString Color.lightOrange )
            , style "color" ( Color.toCssString foreground )
            , style "border-color" ( Color.toCssString borderColor )
            ]
            [ Html.text "(ᵔᴥᵔ)" ]

Built-in colors

This package also provides an "aesthetically reasonable" set of common colors.