mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-11 22:54:27 +02:00
fix (#687)
This commit is contained in:
@@ -57,9 +57,10 @@ struct Rgb48Color : RgbColorBase
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
Rgb48Color(const RgbColor& color)
|
Rgb48Color(const RgbColor& color)
|
||||||
{
|
{
|
||||||
|
// x16 = map(x8, 0, 255, 0, 65535); // refactors to just * 257
|
||||||
R = (uint16_t)color.R * 257; // 257 = MAXUINT16/MAXUINT8 = 65535/255
|
R = (uint16_t)color.R * 257; // 257 = MAXUINT16/MAXUINT8 = 65535/255
|
||||||
G = (uint16_t)color.R * 257;
|
G = (uint16_t)color.G * 257;
|
||||||
B = (uint16_t)color.R * 257;
|
B = (uint16_t)color.B * 257;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
@@ -35,14 +35,6 @@ License along with NeoPixel. If not, see
|
|||||||
#include "Rgbw64Color.h"
|
#include "Rgbw64Color.h"
|
||||||
#include "HtmlColor.h"
|
#include "HtmlColor.h"
|
||||||
|
|
||||||
Rgbw64Color::Rgbw64Color(const RgbwColor& color)
|
|
||||||
{
|
|
||||||
R = (color.R == 0) ? 0 : (color.R << 8 | 0xff);
|
|
||||||
G = (color.G == 0) ? 0 : (color.G << 8 | 0xff);
|
|
||||||
B = (color.B == 0) ? 0 : (color.B << 8 | 0xff);
|
|
||||||
W = (color.W == 0) ? 0 : (color.W << 8 | 0xff);
|
|
||||||
};
|
|
||||||
|
|
||||||
Rgbw64Color::Rgbw64Color(const HslColor& color)
|
Rgbw64Color::Rgbw64Color(const HslColor& color)
|
||||||
{
|
{
|
||||||
Rgb48Color rgbColor(color);
|
Rgb48Color rgbColor(color);
|
||||||
|
@@ -78,7 +78,15 @@ struct Rgbw64Color : RgbColorBase
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// Construct a Rgbw64Color using RgbwColor
|
// Construct a Rgbw64Color using RgbwColor
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
Rgbw64Color(const RgbwColor& color);
|
Rgbw64Color(const RgbwColor& color)
|
||||||
|
{
|
||||||
|
// x16 = map(x8, 0, 255, 0, 65535); // refactors to just * 257
|
||||||
|
R = (uint16_t)color.R * 257; // 257 = MAXUINT16/MAXUINT8 = 65535/255
|
||||||
|
G = (uint16_t)color.G * 257;
|
||||||
|
B = (uint16_t)color.B * 257;
|
||||||
|
W = (uint16_t)color.W * 257;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// Construct a Rgbw64Color using HtmlColor
|
// Construct a Rgbw64Color using HtmlColor
|
||||||
|
Reference in New Issue
Block a user