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

Link to this function

cap(arg, min_max \\ 0..255)

View Source
@spec cap({pos_integer(), pos_integer(), pos_integer()}, Range.t()) :: rgb()
@spec combine_subpixels(rgb()) :: colorint()
Link to this function

convert_to_subpixels(rgb)

View Source
@spec convert_to_subpixels(colorint() | atom() | rgb()) :: rgb()
Link to this function

nscale8(rgb, scale, video \\ true)

View Source
@spec nscale8(rgb(), 0..255, boolean()) :: rgb()
@spec nscale8(rgb(), rgb(), boolean()) :: rgb()
@spec nscale8(colorint(), rgb(), boolean()) :: colorint()
Link to this function

scale8(value, scale, video \\ false)

View Source
@spec scale8(0..255, 0..255, boolean()) :: 0..255
Link to this function

split_into_subpixels(elem)

View Source
@spec split_into_subpixels(colorint()) :: rgb()

Splits the rgb-integer value into it's subpixels and returns an {r,g,b} tupel