newmana/chroma-elm/8.1.0

NOTE: the latest version is 18.2.1

Chroma.Scale

The attempt here is to provide something similar to https://gka.github.io/chroma.js/ but also idiomatic Elm.

Definition

colors : Int -> Data -> Nonempty ExtColor

Interpolate a range of colors from the list of colors in the data.

getColor : Data -> Float -> ExtColor
domain : Nonempty Float -> Data -> Data

Set a new domain like [0,100] rather than the default [0,1]

correctLightness : Data -> Float -> Float

Given a data change the lightness value (need to be LAB).

type alias Data =
{ nanColor : Color
, spread : Float
, domainValues : ( Float, Float )
, pos : Nonempty ( Float, Float )
, paddingValues : ( Float, Float )
, useClasses : Bool
, colorsList : Nonempty ExtColor
, useOut : Bool
, min : Float
, max : Float
, useCorrectLightness : Bool
, gammaValue : Float
}

Configuration data used by most functions.

classes : List Color -> Int -> List Color
createData : Nonempty ExtColor -> Data -> Data

Setup new configuration with the given colors.

Sensible default configuration defaults: RGB, domain 0-1, pos 0, 1,and white and black color range.