Loading...
Searching...
No Matches
hueplusplus::ColorHueStrategy Class Referenceabstract

Virtual base class for all ColorHueStrategies. More...

`#include <hueplusplus/ColorHueStrategy.h>`

Inheritance diagram for hueplusplus::ColorHueStrategy:
[legend]

## Public Member Functions

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

## Detailed Description

Virtual base class for all ColorHueStrategies.

## Constructor & Destructor Documentation

## ~ColorHueStrategy()

virtual hueplusplus::ColorHueStrategy::~ColorHueStrategy | ( |  | ) |

virtual default

Virtual dtor.

## Member Function Documentation

## alertHueSaturation()

virtual bool hueplusplus::ColorHueStrategy::alertHueSaturation | ( | const HueSaturation & | hueSat,
|  | Light & | light ) const

pure virtual

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

Parameters

  hueSat | The color in hue and saturation
  light | A reference of the light

Implemented in hueplusplus::ExtendedColorHueStrategy, and hueplusplus::SimpleColorHueStrategy.

## alertXY()

virtual bool hueplusplus::ColorHueStrategy::alertXY | ( | const XYBrightness & | xy,
|  | Light & | light ) const

pure virtual

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

Parameters

  xy | The color in XY and brightness
  light | A reference of the light

Implemented in hueplusplus::ExtendedColorHueStrategy, and hueplusplus::SimpleColorHueStrategy.

## getColorHueSaturation() [1/2]

virtual HueSaturation hueplusplus::ColorHueStrategy::getColorHueSaturation | ( | const Light & | light | ) | const

pure virtual

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

Note
  This should not update the lights state

Parameters

  light | A const reference of the light

Implemented in hueplusplus::SimpleColorHueStrategy.

## getColorHueSaturation() [2/2]

virtual HueSaturation hueplusplus::ColorHueStrategy::getColorHueSaturation | ( | Light & | light | ) | const

pure virtual

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

Should update the lights state by calling refreshState()

Parameters

  light | A reference of the light

Implemented in hueplusplus::SimpleColorHueStrategy.

## getColorXY() [1/2]

virtual XYBrightness hueplusplus::ColorHueStrategy::getColorXY | ( | const Light & | light | ) | const

pure virtual

Virtual function that returns the current color of the light as xy.

Note
  This should not update the lights state

Parameters

  light | A const reference of the light

Returns
  XY and brightness of current color

Implemented in hueplusplus::SimpleColorHueStrategy.

## getColorXY() [2/2]

virtual XYBrightness hueplusplus::ColorHueStrategy::getColorXY | ( | Light & | light | ) | const

pure virtual

Virtual function that returns the current color of the light as xy.

Should update the lights state by calling refreshState()

Parameters

  light | A reference of the light

Returns
  XY and brightness of current color

Implemented in hueplusplus::SimpleColorHueStrategy.

## setColorHue()

virtual bool hueplusplus::ColorHueStrategy::setColorHue | ( | uint16_t | hue,
|  | uint8_t | transition,
|  | Light & | light ) const

pure virtual

Virtual 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

  hue | The hue of the color
  transition | The time it takes to fade to the new color in multiples of 100ms, 4 = 400ms and should be seen as the default
  light | A reference of the light

Implemented in hueplusplus::SimpleColorHueStrategy.

## setColorHueSaturation()

virtual bool hueplusplus::ColorHueStrategy::setColorHueSaturation | ( | const HueSaturation & | hueSat,
|  | uint8_t | transition,
|  | Light & | light ) const

pure virtual

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

Parameters

  hueSat | Color in hue and satuation.
  transition | The time it takes to fade to the new color in multiples of 100ms, 4 = 400ms and should be seen as the default
  light | A reference of the light

Implemented in hueplusplus::SimpleColorHueStrategy.

## setColorLoop()

virtual bool hueplusplus::ColorHueStrategy::setColorLoop | ( | bool | on,
|  | Light & | light ) const

pure virtual

Virtual 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

  on | Boolean to turn this feature on or off, true/1 for on and false/0 for off
  light | A reference of the light

Implemented in hueplusplus::SimpleColorHueStrategy.

## setColorSaturation()

virtual bool hueplusplus::ColorHueStrategy::setColorSaturation | ( | uint8_t | sat,
|  | uint8_t | transition,
|  | Light & | light ) const

pure virtual

Virtual 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

  sat | The saturation of the color
  transition | The time it takes to fade to the new color in multiples of 100ms, 4 = 400ms and should be seen as the default
  light | A reference of the light

Implemented in hueplusplus::SimpleColorHueStrategy.

## setColorXY()

virtual bool hueplusplus::ColorHueStrategy::setColorXY | ( | const XYBrightness & | xy,
|  | uint8_t | transition,
|  | Light & | light ) const

pure virtual

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

Parameters

  xy | The color in XY and brightness
  transition | The time it takes to fade to the new color in multiples of 100ms, 4 = 400ms and should be seen as the default
  light | A reference of the light

Implemented in hueplusplus::SimpleColorHueStrategy.

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

- include/hueplusplus/ColorHueStrategy.h