hueplusplus  1.0.0
Public Member Functions | List of all members
hueplusplus::SimpleColorHueStrategy Class Reference

#include <hueplusplus/SimpleColorHueStrategy.h>

+ Inheritance diagram for hueplusplus::SimpleColorHueStrategy:
+ Collaboration diagram for hueplusplus::SimpleColorHueStrategy:

Public Member Functions

bool setColorHue (uint16_t hue, uint8_t transition, Light &light) const override
 Function for changing a lights color in hue with a specified transition. More...
 
bool setColorSaturation (uint8_t sat, uint8_t transition, Light &light) const override
 Function for changing a lights color in saturation with a specified transition. More...
 
bool setColorHueSaturation (const HueSaturation &hueSat, uint8_t transition, Light &light) const override
 Function for changing a lights color in hue and saturation format with a specified transition. More...
 
bool setColorXY (const XYBrightness &xy, uint8_t transition, Light &light) const override
 Function for changing a lights color in CIE format with a specified transition. More...
 
bool setColorLoop (bool on, Light &light) const override
 Function for turning on/off the color loop feature of a light. More...
 
bool alertHueSaturation (const HueSaturation &hueSat, Light &light) const override
 Function that lets the light perform one breath cycle in the specified color. More...
 
bool alertXY (const XYBrightness &xy, Light &light) const override
 Function that lets the light perform one breath cycle in the specified color. More...
 
HueSaturation getColorHueSaturation (Light &light) const override
 Function that returns the current color of the light as hue and saturation. More...
 
HueSaturation getColorHueSaturation (const Light &light) const override
 Function that returns the current color of the light as hue and saturation. More...
 
XYBrightness getColorXY (Light &light) const override
 Function that returns the current color of the light as xy. More...
 
XYBrightness getColorXY (const Light &light) const override
 Function that returns the current color of the light as xy. More...
 
- Public Member Functions inherited from hueplusplus::ColorHueStrategy
virtual ~ColorHueStrategy ()=default
 Virtual dtor. More...
 

Detailed Description

Class implementing the functions of ColorHueStrategy

To be used for lights that have only color and no color temperature.

Member Function Documentation

◆ alertHueSaturation()

bool hueplusplus::SimpleColorHueStrategy::alertHueSaturation ( const HueSaturation hueSat,
Light light 
) const
overridevirtual

Function that lets the light perform one breath cycle in the specified color.

Parameters
hueSatThe color in hue and saturation
lightA reference of the light

Blocks for the time a Light::alert() needs

Implements hueplusplus::ColorHueStrategy.

◆ alertXY()

bool hueplusplus::SimpleColorHueStrategy::alertXY ( const XYBrightness xy,
Light light 
) const
overridevirtual

Function that lets the light perform one breath cycle in the specified color.

Parameters
xyThe color in XY and brightness
lightA reference of the light

Implements hueplusplus::ColorHueStrategy.

◆ getColorHueSaturation() [1/2]

HueSaturation hueplusplus::SimpleColorHueStrategy::getColorHueSaturation ( Light light) const
overridevirtual

Function that returns the current color of the light as hue and saturation.

Updates the lights state by calling refreshState()

Parameters
lightA reference of the light
Returns
Pair containing the hue as first value and saturation as second value

Implements hueplusplus::ColorHueStrategy.

◆ getColorHueSaturation() [2/2]

HueSaturation hueplusplus::SimpleColorHueStrategy::getColorHueSaturation ( const Light light) const
overridevirtual

Function that returns the current color of the light as hue and saturation.

Note
This does not update the lights state
Parameters
lightA const reference of the light
Returns
Pair containing the hue as first value and saturation as second value

Implements hueplusplus::ColorHueStrategy.

◆ getColorXY() [1/2]

XYBrightness hueplusplus::SimpleColorHueStrategy::getColorXY ( Light light) const
overridevirtual

Function that returns the current color of the light as xy.

Updates the lights state by calling refreshState()

Parameters
lightA reference of the light
Returns
XY and brightness of current color

Implements hueplusplus::ColorHueStrategy.

◆ getColorXY() [2/2]

XYBrightness hueplusplus::SimpleColorHueStrategy::getColorXY ( const Light light) const
overridevirtual

Function that returns the current color of the light as xy.

Note
This does not update the lights state
Parameters
lightA const reference of the light
Returns
XY and brightness of current color

Implements hueplusplus::ColorHueStrategy.

◆ setColorHue()

bool hueplusplus::SimpleColorHueStrategy::setColorHue ( uint16_t  hue,
uint8_t  transition,
Light light 
) const
overridevirtual

Function for changing a lights color in hue with a specified transition.

The hue ranges from 0 to 65535, whereas 65535 and 0 are red, 25500 is green and 46920 is blue.

Parameters
hueThe hue of the color
transitionThe time it takes to fade to the new color in multiples of 100ms, 4 = 400ms and should be seen as the default
lightA reference of the light

Implements hueplusplus::ColorHueStrategy.

◆ setColorHueSaturation()

bool hueplusplus::SimpleColorHueStrategy::setColorHueSaturation ( const HueSaturation hueSat,
uint8_t  transition,
Light light 
) const
overridevirtual

Function for changing a lights color in hue and saturation format with a specified transition.

Parameters
hueSatColor in hue and satuation.
transitionThe time it takes to fade to the new color in multiples of 100ms, 4 = 400ms and should be seen as the default
lightA reference of the light

Implements hueplusplus::ColorHueStrategy.

◆ setColorLoop()

bool hueplusplus::SimpleColorHueStrategy::setColorLoop ( bool  on,
Light light 
) const
overridevirtual

Function for turning on/off the color loop feature of a light.

Can be theoretically set for any light, but it only works for lights that support this feature. When this feature is activated the light will fade through every color on the current hue and saturation settings. Notice that none of the setter functions check whether this feature is enabled and the colorloop can only be disabled with this function or by simply calling off() and then on(), so you could alternatively call off() and then use any of the setter functions.

Parameters
onBoolean to turn this feature on or off, true/1 for on and false/0 for off
lightA reference of the light

Implements hueplusplus::ColorHueStrategy.

◆ setColorSaturation()

bool hueplusplus::SimpleColorHueStrategy::setColorSaturation ( uint8_t  sat,
uint8_t  transition,
Light light 
) const
overridevirtual

Function for changing a lights color in saturation with a specified transition.

The saturation ranges from 0 to 254, whereas 0 is least saturated (white) and 254 is most saturated (vibrant).

Parameters
satThe saturation of the color
transitionThe time it takes to fade to the new color in multiples of 100ms, 4 = 400ms and should be seen as the default
lightA reference of the light

Implements hueplusplus::ColorHueStrategy.

◆ setColorXY()

bool hueplusplus::SimpleColorHueStrategy::setColorXY ( const XYBrightness xy,
uint8_t  transition,
Light light 
) const
overridevirtual

Function for changing a lights color in CIE format with a specified transition.

Parameters
xyThe color in XY and brightness
transitionThe time it takes to fade to the new color in multiples of 100ms, 4 = 400ms and should be seen as the default
lightA reference of the light

Implements hueplusplus::ColorHueStrategy.


The documentation for this class was generated from the following files: