newmana/chroma-elm/18.1.0

NOTE: the latest version is 18.2.1

Chroma.Scale

Used by Chroma

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]) for all kinds of data.

correctLightness : Data -> Float -> Float

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

type alias Data =
, shared : SharedData
}

Configuration data used by most functions with color specific details.

type alias SharedData =
{ domainValues : ( Float, Float )
, pos : Nonempty ( Float, Float )
, paddingValues : ( Float, Float )
, classes : Maybe (Nonempty Float)
, useCorrectLightness : Bool
, gammaValue : Float
}

Shared configuration used by most functions.

initSharedData : Data -> Data

Setup new configuration with the given colors.

createDiscreteColorData : Nonempty ExtColor -> SharedData -> Data

Create and init a discrete data configuration.

createContinuousColorData : (Float -> ExtColor) -> SharedData -> Data

Create and init a continuous data configuration.

The default color map - black to white.

defaultSharedData : SharedData

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

= ContinuousColor (Float -> ExtColor)
| DiscreteColor (Nonempty ExtColor)

The two types of colors we accept - continuous (a function to color) or discrete (a list of colors).