newmana/chroma-elm/10.1.1

NOTE: the latest version is 18.2.1

Rerouted (retagged, verified). The tag now points at a different commit than when this version was published. The Lamdera package server serves a copy recovered from https://github.com/newmana/chroma-elm.

What we checked: Tag 10.1.1 now points at c09d06b75e39, not the published commit. Rebuilt with git archive from commit 51684c31ed38 of https://github.com/newmana/chroma-elm (zip prefix newmana-chroma-elm-51684c3/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 c7cb31d365d767882e728ab60ac1a1d66f0fd85f.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/newmana/chroma-elm/zipball/10.1.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
, classes : Maybe (Nonempty Float)
, min : Float
, max : Float
, useCorrectLightness : Bool
, gammaValue : Float
}

Configuration data used by most functions.

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.