https://github.com/mdgriffith/elm-color-mixing
Color mixing in elm!
https://github.com/mdgriffith/elm-color-mixing
Last synced: 3 months ago
JSON representation
Color mixing in elm!
- Host: GitHub
- URL: https://github.com/mdgriffith/elm-color-mixing
- Owner: mdgriffith
- License: bsd-3-clause
- Created: 2016-01-27T23:29:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-01-04T09:28:53.000Z (over 6 years ago)
- Last Synced: 2024-10-30T01:38:17.493Z (9 months ago)
- Language: Elm
- Homepage: http://package.elm-lang.org/packages/mdgriffith/elm-color-mixing/latest
- Size: 19.5 KB
- Stars: 9
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Elm Color Mixing
Functions to mix color.
Use the [Elm Core Color type](http://package.elm-lang.org/packages/elm-lang/core/2.1.0/Color) to create your colors and this library to mix them.
This library is modeled off of the [LESSCSS color functions](http://lesscss.org/functions/#color-operations). 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](https://github.com/rtfeldman/elm-css/issues/76)).
You can use `Color.Mixing` with a small helper, like:```elm
import Color.Mixing exposing (..)
import Color exposing (Color)
import CsscssColor : Color -> Css.Color
cssColor color =
let
{ red, green, blue, alpha } =
Color.toRgb color
in
Css.rgba red green blue alpha
```