Fledex.Color.Correction (fledex v0.7.0)

View Source

Definitions and functions to perform color corrections

Summary

Functions

This function corrects an led color with the specified correction.

Calculate the color correction for a single base color.

This function allows to combine several aspects of corrections together to a single correction.

This defines a color correction without correction. I.e. the rgb colors will be with full brightness {255, 255, 255}

Functions

apply_rgb_correction(leds, correction)

@spec apply_rgb_correction(
  [Fledex.Color.Types.rgb()],
  byte() | Fledex.Color.Types.rgb()
) :: [
  Fledex.Color.Types.rgb()
]

This function corrects an led color with the specified correction.

The correction probably should be created by composing the different aspects by using define_correction/3

calculate_single_color_correction(scale, cc, ct)

@spec calculate_single_color_correction(byte(), byte(), byte()) :: byte()

Calculate the color correction for a single base color.

It expects the scale, the color correction and color temperature for the base color to calculate the correction for that base color.

define_correction(scale \\ 255, color_correction, temperature_correction)

This function allows to combine several aspects of corrections together to a single correction.

The elements are:

no_color_correction()

@spec no_color_correction() :: Fledex.Color.Types.rgb()

This defines a color correction without correction. I.e. the rgb colors will be with full brightness {255, 255, 255}