WS2812_RMT Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
ws2812_rmt::Colour Struct Reference

A pixel colour, 8 bit per channel; w is used only by four-channel orders. More...

#include <ws2812_rmt_types.hpp>

Public Member Functions

constexpr uint32_t Packed () const noexcept
 

Static Public Member Functions

static constexpr Colour FromPacked (uint32_t rgb) noexcept
 A colour from 0xRRGGBB.
 
static constexpr Colour FromPackedW (uint32_t wrgb) noexcept
 A colour from 0xWWRRGGBB.
 

Public Attributes

uint8_t r {0}
 Red.
 
uint8_t g {0}
 Green.
 
uint8_t b {0}
 Blue.
 
uint8_t w {0}
 White.
 

Friends

constexpr bool operator== (const Colour &lhs, const Colour &rhs) noexcept=default
 Hidden friend: exact member comparison.
 

Detailed Description

A pixel colour, 8 bit per channel; w is used only by four-channel orders.

Member Function Documentation

◆ FromPacked()

static constexpr Colour ws2812_rmt::Colour::FromPacked ( uint32_t  rgb)
inlinestaticconstexprnoexcept

A colour from 0xRRGGBB.

Parameters
rgbPacked colour; the top byte is ignored.
Returns
The colour, white 0.

◆ FromPackedW()

static constexpr Colour ws2812_rmt::Colour::FromPackedW ( uint32_t  wrgb)
inlinestaticconstexprnoexcept

A colour from 0xWWRRGGBB.

Parameters
wrgbPacked colour with the white byte on top.
Returns
The colour.

◆ Packed()

constexpr uint32_t ws2812_rmt::Colour::Packed ( ) const
inlineconstexprnoexcept
Returns
0xRRGGBB, white ignored.

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