nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ bt_mesh_light_hsl_to_rgb()

uint16_t bt_mesh_light_hsl_to_rgb ( const struct bt_mesh_light_hsl hsl,
enum bt_mesh_rgb_ch  ch 
)

#include <include/bluetooth/mesh/light_hsl.h>

Convert HSL to a 16 bit RGB channel value.

Uses the standard conversion formula to convert HSL to RGB, as described in https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB. Note that the accuracy of the conversion depends on the characteristics of the light source hardware, and may need correction for each channel.

Parameters
[in]hslHSL value.
[in]chRGB color channel.
Returns
The value of the chosen RGB channel for the given HSL value.