Fledex.Color.Functions (fledex v0.7.0)
View SourceA collection of color functions (namely rainbow and gradient)
Summary
Functions
Color correction function: that halfs the intensity of green
Color correction function: that doesn't do anything, i.e. keeps the colors as they are
This function creates a gradient from a start_color to an end_color spread over num_leds
This function creates a sequence of HSV values with the rainbow colors spread over num_leds
leds.
This function creates a sequence of RGB values with the rainbow colors
A conversion function that can be configured to have the desired behavior. Several implementations exist for the hsv2rgb conversion with slightly differen results.
Functions
@spec color_correction_g2(Fledex.Color.Types.rgb()) :: Fledex.Color.Types.rgb()
Color correction function: that halfs the intensity of green
@spec color_correction_none(Fledex.Color.Types.rgb()) :: Fledex.Color.Types.rgb()
Color correction function: that doesn't do anything, i.e. keeps the colors as they are
@spec create_gradient_rgb(pos_integer(), Fledex.Color.RGB.t(), Fledex.Color.RGB.t()) :: [ Fledex.Color.Types.rgb() ]
This function creates a gradient from a start_color to an end_color spread over num_leds
@spec create_rainbow_circular_hsv(pos_integer(), byte(), boolean()) :: [ Fledex.Color.Types.hsv() ]
This function creates a sequence of HSV values with the rainbow colors spread over num_leds
leds.
@spec create_rainbow_circular_rgb( pos_integer(), keyword() ) :: [Fledex.Color.Types.rgb()]
This function creates a sequence of RGB values with the rainbow colors
The options are:
:reversed: The rainbow can go from red (start color) to blue (end color) or the other way around.:initial_hue: The starting color in degree mapped to a byte (e.g.0..255corresponds to0..258). (default: 0)
Additional options that can be specified are those specified in hsv2rgb/2
@spec hsv2rgb( [Fledex.Color.Types.hsv()], keyword() ) :: [Fledex.Color.Types.rgb()]
A conversion function that can be configured to have the desired behavior. Several implementations exist for the hsv2rgb conversion with slightly differen results.
The options are:
:conversion_functions: the desired conversion function (default:Fledex.Color.Conversion.Rainbow.hsv2rgb/2):color_correction: allows for a color correction, seecolor_correction_none/1(default) andcolor_correction_g2