mdgriffith/elm-color-mixing

Color Mixing Functions!


License
BSD-3-Clause
Install
elm-package install mdgriffith/elm-color-mixing 1.1.0

Documentation

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