Skip to content

dividat/elm-color-mixing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elm Color Mixing

Functions to mix color.

Use the Elm Core Color type to create your colors and this library to mix them.

This library is modeled off of the LESSCSS color functions. See their documentation for general descriptions of each color operation.

Working with elm-css

While elm-css do not use Color internally (see issue 76). You can use Color.Mixing with a small helper, like:

import Color.Mixing exposing (..)
import Color exposing (Color)
import Css

cssColor : Color -> Css.Color
cssColor color =
    let
        { red, green, blue, alpha } =
            Color.toRgb color
    in
        Css.rgba red green blue alpha