forked from Makuna/NeoPixelBus
48 conversion constructors (#688)
This commit is contained in:
@@ -33,6 +33,16 @@ License along with NeoPixel. If not, see
|
|||||||
#include "HsbColor.h"
|
#include "HsbColor.h"
|
||||||
#include "HtmlColor.h"
|
#include "HtmlColor.h"
|
||||||
|
|
||||||
|
#include "RgbwColor.h"
|
||||||
|
#include "Rgbw64Color.h"
|
||||||
|
|
||||||
|
Rgb48Color::Rgb48Color(const Rgbw64Color& color) :
|
||||||
|
R(color.R),
|
||||||
|
G(color.G),
|
||||||
|
B(color.B)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Rgb48Color::Rgb48Color(const HslColor& color)
|
Rgb48Color::Rgb48Color(const HslColor& color)
|
||||||
{
|
{
|
||||||
float r;
|
float r;
|
||||||
|
@@ -25,6 +25,8 @@ License along with NeoPixel. If not, see
|
|||||||
-------------------------------------------------------------------------*/
|
-------------------------------------------------------------------------*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
struct Rgbw64Color; // forward declared
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// Rgb48Color represents a color object that is represented by Red, Green, Blue
|
// Rgb48Color represents a color object that is represented by Red, Green, Blue
|
||||||
// component values. It contains helpful color routines to manipulate the
|
// component values. It contains helpful color routines to manipulate the
|
||||||
@@ -63,6 +65,19 @@ struct Rgb48Color : RgbColorBase
|
|||||||
B = (uint16_t)color.B * 257;
|
B = (uint16_t)color.B * 257;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
// explicitly Construct a Rgb48Color using RgbwColor
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
explicit Rgb48Color(const RgbwColor& color)
|
||||||
|
{
|
||||||
|
*this = RgbColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
// explicitly Construct a Rgb48Color using Rgbw64Color
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
explicit Rgb48Color(const Rgbw64Color& color);
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// Construct a Rgb48Color using HtmlColor
|
// Construct a Rgb48Color using HtmlColor
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
@@ -33,6 +33,7 @@ License along with NeoPixel. If not, see
|
|||||||
#include "HslColor.h"
|
#include "HslColor.h"
|
||||||
#include "HsbColor.h"
|
#include "HsbColor.h"
|
||||||
#include "HtmlColor.h"
|
#include "HtmlColor.h"
|
||||||
|
|
||||||
#include "RgbwColor.h"
|
#include "RgbwColor.h"
|
||||||
|
|
||||||
RgbColor::RgbColor(const RgbwColor& color) :
|
RgbColor::RgbColor(const RgbwColor& color) :
|
||||||
|
Reference in New Issue
Block a user