newmana/chroma-elm/4.2.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

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 =
{ mode : Mode
, nanColor : Color
, spread : Float
, isFixed : Bool
, domainValues : Nonempty Float
, pos : Nonempty ( Float, Float )
, paddingValues : Nonempty Float
, useClasses : Bool
, colors : Nonempty ExtColor
, useOut : Bool
, min : Float
, max : Float
, useCorrectLightness : Bool
, gammaValue : Float
}

Configuration data used by most functions.

classes : List Color -> Int -> List Color

TBD

createData : Nonempty ExtColor -> Data -> Data

Setup new configuration with the given colours.

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