jsuder-xx/seven-segment/1.0.1

SevenSegment.Color

A very minimal / lightweight Color representation that should be easily interoperable with other color libraries.

Constructor

type alias Color =
{ red : Int
, green : Int
, blue : Int
}

A very minimal / lightweight Color representation that should be easily interoperable with other color libraries. This is exposed as a simple type alias because

  • There should be no reason for this to change in the future based on how it is used in this library.
  • It is not intended to be a rich Api.

Analysis

luminosity : Color -> Int

The luminosity (brightness) of a color as a value from 0..255.

Convert to String

toRGB : Color -> String

Encode a color as an RGB string.

toRGBA : Float -> Color -> String

Encode a color as an RGBA string.