HtmlColor

This commit is contained in:
Makuna
2016-03-05 18:50:23 -08:00
parent 6eba5a9615
commit c7b07b43cd
9 changed files with 96 additions and 8 deletions
+8 -2
View File
@@ -27,6 +27,7 @@ License along with NeoPixel. If not, see
#include "RgbColor.h"
#include "HslColor.h"
#include "HsbColor.h"
#include "HtmlColor.h"
static float _CalcColor(float p, float q, float t)
{
@@ -47,7 +48,12 @@ static float _CalcColor(float p, float q, float t)
return p;
}
RgbColor::RgbColor(HslColor color)
RgbColor::RgbColor(const HtmlColor& color) :
R((color.Color >> 16) & 0xff), G((color.Color >> 8) & 0xff), B(color.Color & 0xff)
{
}
RgbColor::RgbColor(const HslColor& color)
{
float r;
float g;
@@ -76,7 +82,7 @@ RgbColor::RgbColor(HslColor color)
B = (uint8_t)(b * 255.0f);
}
RgbColor::RgbColor(HsbColor color)
RgbColor::RgbColor(const HsbColor& color)
{
float r;
float g;