View Source Fledex.Color.Utils (fledex v0.1.1)
Summary
Functions
This function adds the given subpixels [{r1,g1,b1}, {r2,g2,b2}, ...]
together.
The result {r1+r2+..., g1+g2+..., b1+b2+...} is probably outside of the standard
8bit range and will have to be rescaled
This function rescales the rgb values with count (default: 1) and combines them to a single integer
Splits the rgb-integer value into it's subpixels and returns an
{r,g,b}
tupel
Types
@type colorint() :: 0..16_777_215
@type hsv() :: {hue :: 0..255, saturation :: 0..255, value :: 0..255}
@type rgb() :: {red :: 0..255, green :: 0..255, blue :: 0..255}
Functions
@spec add_subpixels([rgb()]) :: {pos_integer(), pos_integer(), pos_integer()}
This function adds the given subpixels [{r1,g1,b1}, {r2,g2,b2}, ...]
together.
The result {r1+r2+..., g1+g2+..., b1+b2+...} is probably outside of the standard
8bit range and will have to be rescaled
@spec avg({pos_integer(), pos_integer(), pos_integer()}, pos_integer()) :: rgb()
This function rescales the rgb values with count (default: 1) and combines them to a single integer
@spec cap({pos_integer(), pos_integer(), pos_integer()}, Range.t()) :: rgb()
@spec scale8(0..255, 0..255, boolean()) :: 0..255
Splits the rgb-integer value into it's subpixels and returns an
{r,g,b}
tupel