Fledex.Color.RGBW (fledex v0.8.0)

Copy Markdown View Source

This module represents an RGBW color. Fledex does commonly use a {r, g, b}-tuple, but this module allows to also set the white (:w1) or even a secondary white color (:w2) led commonly found in modern led strips (e.g. WS2813B-RGBW).

It also provides the necessary conversion functions to the 0xw2w2w1w1rrggbb (colorint) and{r,g,b} (tuple) representations.

Summary

Functions

creates a new RGB structure from any kind of color structure

Converts an Fledex.Color.RGB color to a rgb tuple

Types

t()

@type t() :: %Fledex.Color.RGBW{
  b: byte(),
  g: byte(),
  r: byte(),
  w1: byte(),
  w2: byte()
}

Functions

new(color)

@spec new(Fledex.Color.Types.color()) :: t()

creates a new RGB structure from any kind of color structure

to_tuple(rgb)

Converts an Fledex.Color.RGB color to a rgb tuple