diff --git a/src/NeoPixelBus.h b/src/NeoPixelBus.h index a9ec865..2c82079 100644 --- a/src/NeoPixelBus.h +++ b/src/NeoPixelBus.h @@ -53,7 +53,6 @@ License along with NeoPixel. If not, see #include "internal/RgbColor.h" #include "internal/HslColor.h" #include "internal/HsbColor.h" -#include "internal/HtmlColor.h" #include "internal/RgbwColor.h" #include "internal/SegmentDigit.h" diff --git a/src/NeoPixelSegmentBus.h b/src/NeoPixelSegmentBus.h index ebe16ce..f47cc84 100644 --- a/src/NeoPixelSegmentBus.h +++ b/src/NeoPixelSegmentBus.h @@ -56,7 +56,7 @@ public: } void SetString(uint16_t indexDigit, - const String& str, + const std::string& str, uint8_t brightness, uint8_t defaultBrightness = 0) { diff --git a/src/internal/DotStarColorFeatures.h b/src/internal/DotStarColorFeatures.h index 918a12e..eae0ce3 100644 --- a/src/internal/DotStarColorFeatures.h +++ b/src/internal/DotStarColorFeatures.h @@ -64,19 +64,6 @@ public: } } - static void movePixelsInc_P(uint8_t* pPixelDest, PGM_VOID_P pPixelSrc, uint16_t count) - { - uint8_t* pEnd = pPixelDest + (count * PixelSize); - const uint8_t* pSrc = (const uint8_t*)pPixelSrc; - while (pPixelDest < pEnd) - { - *pPixelDest++ = pgm_read_byte(pSrc++); - *pPixelDest++ = pgm_read_byte(pSrc++); - *pPixelDest++ = pgm_read_byte(pSrc++); - *pPixelDest++ = pgm_read_byte(pSrc++); - } - } - static void movePixelsDec(uint8_t* pPixelDest, const uint8_t* pPixelSrc, uint16_t count) { uint8_t* pDestBack = pPixelDest + (count * PixelSize); @@ -131,19 +118,6 @@ public: } } - static void movePixelsInc_P(uint8_t* pPixelDest, PGM_VOID_P pPixelSrc, uint16_t count) - { - uint8_t* pEnd = pPixelDest + (count * PixelSize); - const uint8_t* pSrc = (const uint8_t*)pPixelSrc; - while (pPixelDest < pEnd) - { - *pPixelDest++ = pgm_read_byte(pSrc++); - *pPixelDest++ = pgm_read_byte(pSrc++); - *pPixelDest++ = pgm_read_byte(pSrc++); - *pPixelDest++ = pgm_read_byte(pSrc++); - } - } - static void movePixelsDec(uint8_t* pPixelDest, const uint8_t* pPixelSrc, uint16_t count) { uint8_t* pDestBack = pPixelDest + (count * PixelSize); @@ -228,20 +202,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - pgm_read_byte(p++); // ignore the first byte - color.B = pgm_read_byte(p++); - color.G = pgm_read_byte(p++); - color.R = pgm_read_byte(p); - - return color; - } - }; class DotStarLbgrFeature : public DotStar4ElementsNoSettings @@ -269,20 +229,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.W = pgm_read_byte(p++) & 0x1F; // mask out upper three bits - color.B = pgm_read_byte(p++); - color.G = pgm_read_byte(p++); - color.R = pgm_read_byte(p); - - return color; - } - }; class DotStarGrbFeature : public DotStar3ElementsNoSettings @@ -310,20 +256,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - pgm_read_byte(p++); // ignore the first byte - color.G = pgm_read_byte(p++); - color.R = pgm_read_byte(p++); - color.B = pgm_read_byte(p); - - return color; - } - }; class DotStarLgrbFeature : public DotStar4ElementsNoSettings @@ -351,20 +283,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.W = pgm_read_byte(p++) & 0x1F; // mask out upper three bits - color.G = pgm_read_byte(p++); - color.R = pgm_read_byte(p++); - color.B = pgm_read_byte(p); - - return color; - } - }; /* RGB Feature -- Some APA102s ship in RGB order */ @@ -393,20 +311,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - pgm_read_byte(p++); // ignore the first byte - color.R = pgm_read_byte(p++); - color.G = pgm_read_byte(p++); - color.B = pgm_read_byte(p); - - return color; - } - }; class DotStarLrgbFeature : public DotStar4ElementsNoSettings @@ -434,20 +338,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.W = pgm_read_byte(p++) & 0x1F; // mask out upper three bits - color.R = pgm_read_byte(p++); - color.G = pgm_read_byte(p++); - color.B = pgm_read_byte(p); - - return color; - } - }; /* RBG Feature -- Some APA102s ship in RBG order */ class DotStarRbgFeature : public DotStar3ElementsNoSettings @@ -475,20 +365,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - pgm_read_byte(p++); // ignore the first byte - color.R = pgm_read_byte(p++); - color.B = pgm_read_byte(p++); - color.G = pgm_read_byte(p); - - return color; - } - }; class DotStarLrbgFeature : public DotStar4ElementsNoSettings @@ -516,20 +392,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.W = pgm_read_byte(p++) & 0x1F; // mask out upper three bits - color.R = pgm_read_byte(p++); - color.B = pgm_read_byte(p++); - color.G = pgm_read_byte(p); - - return color; - } - }; /* GBR Feature -- Some APA102s ship in GBR order */ @@ -558,20 +420,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - pgm_read_byte(p++); // ignore the first byte - color.G = pgm_read_byte(p++); - color.B = pgm_read_byte(p++); - color.R = pgm_read_byte(p); - - return color; - } - }; class DotStarLgbrFeature : public DotStar4ElementsNoSettings @@ -599,20 +447,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.W = pgm_read_byte(p++) & 0x1F; // mask out upper three bits - color.G = pgm_read_byte(p++); - color.B = pgm_read_byte(p++); - color.R = pgm_read_byte(p); - - return color; - } - }; /* BRG Feature -- Some APA102s ship in BRG order */ class DotStarBrgFeature : public DotStar3ElementsNoSettings @@ -640,20 +474,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - pgm_read_byte(p++); // ignore the first byte - color.B = pgm_read_byte(p++); - color.R = pgm_read_byte(p++); - color.G = pgm_read_byte(p); - - return color; - } - }; class DotStarLbrgFeature : public DotStar4ElementsNoSettings @@ -681,18 +501,4 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.W = pgm_read_byte(p++) & 0x1F; // mask out upper three bits - color.B = pgm_read_byte(p++); - color.R = pgm_read_byte(p++); - color.G = pgm_read_byte(p); - - return color; - } - }; diff --git a/src/internal/HtmlColor.cpp b/src/internal/HtmlColor.cpp deleted file mode 100644 index 018d58f..0000000 --- a/src/internal/HtmlColor.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/*------------------------------------------------------------------------- -This file contains the HtmlColor implementation - -Written by Unai Uribarri - -I invest time and resources providing this open source code, -please support me by dontating (see https://github.com/Makuna/NeoPixelBus) - -------------------------------------------------------------------------- -This file is part of the Makuna/NeoPixelBus library. - -NeoPixelBus is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as -published by the Free Software Foundation, either version 3 of -the License, or (at your option) any later version. - -NeoPixelBus is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with NeoPixel. If not, see -. --------------------------------------------------------------------------*/ -#include "HtmlColor.h" - -static inline char hexdigit(uint8_t v) -{ - return v + (v < 10 ? '0' : 'a' - 10); -} - - -size_t HtmlColor::ToNumericalString(char* buf, size_t bufSize) const -{ - size_t bufLen = bufSize - 1; - - if (bufLen-- > 0) - { - if (bufLen > 0) - { - buf[0] = '#'; - } - - uint32_t color = Color; - for (uint8_t indexDigit = 6; indexDigit > 0; indexDigit--) - { - if (bufLen > indexDigit) - { - buf[indexDigit] = hexdigit(color & 0x0000000f); - } - color >>= 4; - } - - buf[(bufLen < 7 ? bufLen : 7)] = 0; - } - return 7; -} diff --git a/src/internal/HtmlColor.h b/src/internal/HtmlColor.h deleted file mode 100644 index 238d4ac..0000000 --- a/src/internal/HtmlColor.h +++ /dev/null @@ -1,340 +0,0 @@ -/*------------------------------------------------------------------------- -HtmlColor provides a color object that can be directly consumed by NeoPixelBus - -Written by Michael C. Miller. - -I invest time and resources providing this open source code, -please support me by dontating (see https://github.com/Makuna/NeoPixelBus) - -------------------------------------------------------------------------- -This file is part of the Makuna/NeoPixelBus library. - -NeoPixelBus is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as -published by the Free Software Foundation, either version 3 of -the License, or (at your option) any later version. - -NeoPixelBus is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with NeoPixel. If not, see -. --------------------------------------------------------------------------*/ -#pragma once - -#include -#include "RgbColor.h" - -#define MAX_HTML_COLOR_NAME_LEN 21 - -#ifndef pgm_read_ptr -// ESP8266 doesn't define this macro -#define pgm_read_ptr(addr) (*reinterpret_cast(addr)) -#endif - -#ifndef countof -#define countof(array) (sizeof(array)/sizeof(array[0])) -#endif - -// ------------------------------------------------------------------------ -// HtmlColorPair represents an association between a name and a HTML color code -// ------------------------------------------------------------------------ -struct HtmlColorPair -{ - PGM_P Name; - uint32_t Color; -}; - -// ------------------------------------------------------------------------ -// HtmlShortColorNames is a template class used for Parse and ToString -// ------------------------------------------------------------------------ -class HtmlShortColorNames -{ -public: - static const HtmlColorPair* Pair(uint8_t index); - static uint8_t Count(); -}; - -// ------------------------------------------------------------------------ -// HtmlColorNames is a template class used for Parse and ToString -// ------------------------------------------------------------------------ -class HtmlColorNames -{ -public: - static const HtmlColorPair* Pair(uint8_t index); - static uint8_t Count(); -}; - -// ------------------------------------------------------------------------ -// HtmlColor represents a color object that is represented by a single uint32 -// value. It contains minimal routines and used primarily as a helper to -// initialize other color objects -// ------------------------------------------------------------------------ -struct HtmlColor -{ - // ------------------------------------------------------------------------ - // Construct a HtmlColor using a single value (0-0xffffff) - // This works well for hexidecimal color definitions - // 0xff0000 = red, 0x00ff00 = green, and 0x0000ff = blue - // ------------------------------------------------------------------------ - HtmlColor(uint32_t color) : - Color(color) - { - }; - - // ------------------------------------------------------------------------ - // Construct a HtmlColor using RgbColor - // ------------------------------------------------------------------------ - HtmlColor(const RgbColor& color) - { - Color = (uint32_t)color.R << 16 | (uint32_t)color.G << 8 | (uint32_t)color.B; - } - - // ------------------------------------------------------------------------ - // Construct a HtmlColor that will have its values set in latter operations - // CAUTION: The Color member is not initialized and may not be consistent - // ------------------------------------------------------------------------ - HtmlColor() - { - }; - - // ------------------------------------------------------------------------ - // Comparison operators - // ------------------------------------------------------------------------ - bool operator==(const HtmlColor& other) const - { - return (Color == other.Color); - }; - - bool operator!=(const HtmlColor& other) const - { - return !(*this == other); - }; - - // ------------------------------------------------------------------------ - // Parse a HTML4/CSS3 color name - // T_HTMLCOLORNAMES - template class that defines the collection of names - // name - the color name - // nameSize - the max size of name to check - // - // returns - zero if failed, or the number of chars parsed - // - // It will stop parsing name when a null terminator is reached, - // nameSize is reached, no match is found in the name/color pair table, or - // a non-alphanumeric is read like seperators or whitespace. - // - // It also accepts 3 or 6 digit hexadecimal notation (#rgb or #rrggbb), - // but it doesn't accept RGB, RGBA nor HSL values. - // - // See https://www.w3.org/TR/css3-color/#SRGB - // - // name must point to the first non-whitespace character to be parsed - // parsing will stop at the first non-alpha numeric - // - // Name MUST NOT be a PROGMEM pointer - // - // examples: - // Parse(buff, buffSize); - // Parse(buff, buffSize); - // ------------------------------------------------------------------------ - - template size_t Parse(const char* name, size_t nameSize) - { - if (nameSize > 0) - { - if (name[0] == '#') - { - // Parse an hexadecimal notation "#rrbbgg" or "#rgb" - // - uint8_t temp[6]; // stores preconverted chars to hex values - uint8_t tempSize = 0; - - for (uint8_t indexChar = 1; indexChar < nameSize && indexChar < 8; ++indexChar) - { - char c = name[indexChar]; - if (c >= '0' && c <= '9') - { - c -= '0'; - } - else - { - // Convert a letter to lower case (only for ASCII letters) - // It's faster & smaller than tolower() - c |= 32; - if (c >= 'a' && c <= 'f') - { - c = c - 'a' + 10; - } - else - { - // we found an non hexidecimal char - // which could be null, deliminator, or other spacing - break; - } - } - - temp[tempSize] = c; - tempSize++; - } - - if (tempSize != 3 && tempSize != 6) - { - // invalid count of numerical chars - return 0; - } - else - { - uint32_t color = 0; - for (uint8_t indexChar = 0; indexChar < tempSize; ++indexChar) - { - color = color * 16 + temp[indexChar]; - if (tempSize == 3) - { - // 3 digit hexadecimal notation can be supported easily - // duplicating digits. - color = color * 16 + temp[indexChar]; - } - } - - Color = color; - return tempSize; - } - } - else - { - // parse a standard name for the color - // - - // the normal list is small enough a binary search isn't interesting, - for (uint8_t indexName = 0; indexName < T_HTMLCOLORNAMES::Count(); ++indexName) - { - const HtmlColorPair* colorPair = T_HTMLCOLORNAMES::Pair(indexName); - PGM_P searchName = reinterpret_cast(pgm_read_ptr(&(colorPair->Name))); - size_t str1Size = nameSize; - const char* str1 = name; - const char* str2P = searchName; - - uint16_t result; - - while (str1Size > 0) - { - char ch1 = tolower(*str1++); - char ch2 = tolower(pgm_read_byte(str2P++)); - result = ch1 - ch2; - if (result != 0 || ch2 == '\0') - { - if (ch2 == '\0' && !isalnum(ch1)) - { - // the string continues but is not part of a - // valid color name, - // ends in white space, deliminator, etc - result = 0; - } - break; - } - result = -1; // have not reached the end of searchName; - str1Size--; - } - - if (result == 0) - { - Color = pgm_read_dword(&colorPair->Color); - return nameSize - str1Size; - } - } - } - } - - return 0; - } - - template size_t Parse(const char* name) - { - return Parse(name, MAX_HTML_COLOR_NAME_LEN + 1); - } - - template size_t Parse(String const &name) - { - return Parse(name.c_str(), name.length() + 1); - } - - // ------------------------------------------------------------------------ - // Converts this color code to its HTML4/CSS3 name - // T_HTMLCOLORNAMES - template class that defines the collection of names - // buf - buffer to write the string - // bufSize - actual size of buf array - // - // It returns the number of chars required not including the NUL terminator. - // - // If there is not enough space in the buffer, it will write as many - // characters as allowed and will always finish the buffer with a NUL char - // - // examples: - // ToString(buf, bufSize); - // ToString(buf, bufSize); - // ------------------------------------------------------------------------ - - template size_t ToString(char* buf, size_t bufSize) const - { - // search for a color value/name pairs first - for (uint8_t indexName = 0; indexName < T_HTMLCOLORNAMES::Count(); ++indexName) - { - const HtmlColorPair* colorPair = T_HTMLCOLORNAMES::Pair(indexName); - if (pgm_read_dword(&colorPair->Color) == Color) - { - PGM_P name = (PGM_P)pgm_read_ptr(&colorPair->Name); - strncpy_P(buf, name, bufSize); - return strlen_P(name); - } - } - - // no color name pair match, convert using numerical format - return ToNumericalString(buf, bufSize); - } - - // ------------------------------------------------------------------------ - // Converts this color code to its HTML4/CSS3 numerical name - // - // buf - buffer to write the string - // bufSize - actual size of buf array - // - // It returns the number of chars required not including the NUL terminator. - // - // If there is not enough space in the buffer, it will write as many - // characters as allowed and will always finish the buffer with a NUL char - // ------------------------------------------------------------------------ - - size_t ToNumericalString(char* buf, size_t bufSize) const; - - // ------------------------------------------------------------------------ - // BilinearBlend between four colors by the amount defined by 2d variable - // c00 - upper left quadrant color - // c01 - upper right quadrant color - // c10 - lower left quadrant color - // c11 - lower right quadrant color - // x - unit value (0.0 - 1.0) that defines the blend progress in horizontal space - // y - unit value (0.0 - 1.0) that defines the blend progress in vertical space - // ------------------------------------------------------------------------ - - static HtmlColor BilinearBlend(const HtmlColor& c00, - const HtmlColor& c01, - const HtmlColor& c10, - const HtmlColor& c11, - float x, - float y) - { - return RgbColor::BilinearBlend(c00, c01, c10, c11, x, y); - } - - // ------------------------------------------------------------------------ - // Color member (0-0xffffff) where - // 0xff0000 is red - // 0x00ff00 is green - // 0x0000ff is blue - // ------------------------------------------------------------------------ - uint32_t Color; -}; - diff --git a/src/internal/HtmlColorNameStrings.cpp b/src/internal/HtmlColorNameStrings.cpp deleted file mode 100644 index 87dda4b..0000000 --- a/src/internal/HtmlColorNameStrings.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/*------------------------------------------------------------------------- -HtmlColorNameStrings provides the implemenation of the color string names - -Written by Michael C. Miller. - -I invest time and resources providing this open source code, -please support me by dontating (see https://github.com/Makuna/NeoPixelBus) - -------------------------------------------------------------------------- -This file is part of the Makuna/NeoPixelBus library. - -NeoPixelBus is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as -published by the Free Software Foundation, either version 3 of -the License, or (at your option) any later version. - -NeoPixelBus is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with NeoPixel. If not, see -. --------------------------------------------------------------------------*/ - -#include "HtmlColorNameStrings.h" - -/* HTML4 color names */ -const char c_HtmlNameAqua[] PROGMEM = "aqua"; -const char c_HtmlNameBlack[] PROGMEM = "black"; -const char c_HtmlNameBlue[] PROGMEM = "blue"; -const char c_HtmlNameFuchsia[] PROGMEM = "fuchsia"; -const char c_HtmlNameGray[] PROGMEM = "gray"; -const char c_HtmlNameGreen[] PROGMEM = "green"; -const char c_HtmlNameLime[] PROGMEM = "lime"; -const char c_HtmlNameMaroon[] PROGMEM = "maroon"; -const char c_HtmlNameNavy[] PROGMEM = "navy"; -const char c_HtmlNameOlive[] PROGMEM = "olive"; -const char c_HtmlNameOrange[] PROGMEM = "orange"; -const char c_HtmlNamePurple[] PROGMEM = "purple"; -const char c_HtmlNameRed[] PROGMEM = "red"; -const char c_HtmlNameSilver[] PROGMEM = "silver"; -const char c_HtmlNameTeal[] PROGMEM = "teal"; -const char c_HtmlNameWhite[] PROGMEM = "white"; -const char c_HtmlNameYellow[] PROGMEM = "yellow"; - -/* Additional CSS3 color names */ -const char c_HtmlNameAliceBlue[] PROGMEM = "aliceblue"; -const char c_HtmlNameAntiqueWhite[] PROGMEM = "antiquewhite"; -const char c_HtmlNameAquamarine[] PROGMEM = "aquamarine"; -const char c_HtmlNameAzure[] PROGMEM = "azure"; -const char c_HtmlNameBeige[] PROGMEM = "beige"; -const char c_HtmlNameBisque[] PROGMEM = "bisque"; -const char c_HtmlNameBlanchedAlmond[] PROGMEM = "blanchedalmond"; -const char c_HtmlNameBlueViolet[] PROGMEM = "blueviolet"; -const char c_HtmlNameBrown[] PROGMEM = "brown"; -const char c_HtmlNameBurlyWood[] PROGMEM = "burlywood"; -const char c_HtmlNameCadetBlue[] PROGMEM = "cadetblue"; -const char c_HtmlNameChartreuse[] PROGMEM = "chartreuse"; -const char c_HtmlNameChocolate[] PROGMEM = "chocolate"; -const char c_HtmlNameCoral[] PROGMEM = "coral"; -const char c_HtmlNameCornflowerBlue[] PROGMEM = "cornflowerblue"; -const char c_HtmlNameCornsilk[] PROGMEM = "cornsilk"; -const char c_HtmlNameCrimson[] PROGMEM = "crimson"; -const char c_HtmlNameCyan[] PROGMEM = "cyan"; -const char c_HtmlNameDarkBlue[] PROGMEM = "darkblue"; -const char c_HtmlNameDarkCyan[] PROGMEM = "darkcyan"; -const char c_HtmlNameDarkGoldenrod[] PROGMEM = "darkgoldenrod"; -const char c_HtmlNameDarkGray[] PROGMEM = "darkgray"; -const char c_HtmlNameDarkGreen[] PROGMEM = "darkgreen"; -const char c_HtmlNameDarkGrey[] PROGMEM = "darkgrey"; -const char c_HtmlNameDarkKhaki[] PROGMEM = "darkkhaki"; -const char c_HtmlNameDarkMagenta[] PROGMEM = "darkmagenta"; -const char c_HtmlNameDarkOliveGreen[] PROGMEM = "darkolivegreen"; -const char c_HtmlNameDarkOrange[] PROGMEM = "darkorange"; -const char c_HtmlNameDarkOrchid[] PROGMEM = "darkorchid"; -const char c_HtmlNameDarkRed[] PROGMEM = "darkred"; -const char c_HtmlNameDarkSalmon[] PROGMEM = "darksalmon"; -const char c_HtmlNameDarkSeaGreen[] PROGMEM = "darkseagreen"; -const char c_HtmlNameDarkSlateBlue[] PROGMEM = "darkslateblue"; -const char c_HtmlNameDarkSlateGray[] PROGMEM = "darkslategray"; -const char c_HtmlNameDarkSlateGrey[] PROGMEM = "darkslategrey"; -const char c_HtmlNameDarkTurquoise[] PROGMEM = "darkturquoise"; -const char c_HtmlNameDarkViolet[] PROGMEM = "darkviolet"; -const char c_HtmlNameDeepPink[] PROGMEM = "deeppink"; -const char c_HtmlNameDeepSkyBlue[] PROGMEM = "deepskyblue"; -const char c_HtmlNameDimGray[] PROGMEM = "dimgray"; -const char c_HtmlNameDimGrey[] PROGMEM = "dimgrey"; -const char c_HtmlNameDodgerBlue[] PROGMEM = "dodgerblue"; -const char c_HtmlNameFirebrick[] PROGMEM = "firebrick"; -const char c_HtmlNameFloralWhite[] PROGMEM = "floralwhite"; -const char c_HtmlNameForestGreen[] PROGMEM = "forestgreen"; -const char c_HtmlNameGainsboro[] PROGMEM = "gainsboro"; -const char c_HtmlNameGhostWhite[] PROGMEM = "ghostwhite"; -const char c_HtmlNameGold[] PROGMEM = "gold"; -const char c_HtmlNameGoldenrod[] PROGMEM = "goldenrod"; -const char c_HtmlNameGreenYellow[] PROGMEM = "greenyellow"; -const char c_HtmlNameGrey[] PROGMEM = "grey"; -const char c_HtmlNameHoneydew[] PROGMEM = "honeydew"; -const char c_HtmlNameHotPink[] PROGMEM = "hotpink"; -const char c_HtmlNameIndianRed[] PROGMEM = "indianred"; -const char c_HtmlNameIndigo[] PROGMEM = "indigo"; -const char c_HtmlNameIvory[] PROGMEM = "ivory"; -const char c_HtmlNameKhaki[] PROGMEM = "khaki"; -const char c_HtmlNameLavender[] PROGMEM = "lavender"; -const char c_HtmlNameLavenderBlush[] PROGMEM = "lavenderblush"; -const char c_HtmlNameLawnGreen[] PROGMEM = "lawngreen"; -const char c_HtmlNameLemonChiffon[] PROGMEM = "lemonchiffon"; -const char c_HtmlNameLightBlue[] PROGMEM = "lightblue"; -const char c_HtmlNameLightCoral[] PROGMEM = "lightcoral"; -const char c_HtmlNameLightCyan[] PROGMEM = "lightcyan"; -const char c_HtmlNameLightGoldenrodYellow[] PROGMEM = "lightgoldenrodyellow"; -const char c_HtmlNameLightGray[] PROGMEM = "lightgray"; -const char c_HtmlNameLightGreen[] PROGMEM = "lightgreen"; -const char c_HtmlNameLightGrey[] PROGMEM = "lightgrey"; -const char c_HtmlNameLightPink[] PROGMEM = "lightpink"; -const char c_HtmlNameLightSalmon[] PROGMEM = "lightsalmon"; -const char c_HtmlNameLightSeaGreen[] PROGMEM = "lightseagreen"; -const char c_HtmlNameLightSkyBlue[] PROGMEM = "lightskyblue"; -const char c_HtmlNameLightSlateGray[] PROGMEM = "lightslategray"; -const char c_HtmlNameLightSlateGrey[] PROGMEM = "lightslategrey"; -const char c_HtmlNameLightSteelBlue[] PROGMEM = "lightsteelblue"; -const char c_HtmlNameLightYellow[] PROGMEM = "lightyellow"; -const char c_HtmlNameLimeGreen[] PROGMEM = "limegreen"; -const char c_HtmlNameLinen[] PROGMEM = "linen"; -const char c_HtmlNameMagenta[] PROGMEM = "magenta"; -const char c_HtmlNameMediumAquamarine[] PROGMEM = "mediumaquamarine"; -const char c_HtmlNameMediumBlue[] PROGMEM = "mediumblue"; -const char c_HtmlNameMediumOrchid[] PROGMEM = "mediumorchid"; -const char c_HtmlNameMediumPurple[] PROGMEM = "mediumpurple"; -const char c_HtmlNameMediumSeagreen[] PROGMEM = "mediumseagreen"; -const char c_HtmlNameMediumSlateBlue[] PROGMEM = "mediumslateblue"; -const char c_HtmlNameMediumSpringGreen[] PROGMEM = "mediumspringgreen"; -const char c_HtmlNameMediumTurquoise[] PROGMEM = "mediumturquoise"; -const char c_HtmlNameMediumVioletRed[] PROGMEM = "mediumvioletred"; -const char c_HtmlNameMidnightBlue[] PROGMEM = "midnightblue"; -const char c_HtmlNameMintCream[] PROGMEM = "mintcream"; -const char c_HtmlNameMistyRose[] PROGMEM = "mistyrose"; -const char c_HtmlNameMoccasin[] PROGMEM = "moccasin"; -const char c_HtmlNameNavajoWhite[] PROGMEM = "navajowhite"; -const char c_HtmlNameOldLace[] PROGMEM = "oldlace"; -const char c_HtmlNameOliveDrab[] PROGMEM = "olivedrab"; -const char c_HtmlNameOrangeRed[] PROGMEM = "orangered"; -const char c_HtmlNameOrchid[] PROGMEM = "orchid"; -const char c_HtmlNamePaleGoldenrod[] PROGMEM = "palegoldenrod"; -const char c_HtmlNamePaleGreen[] PROGMEM = "palegreen"; -const char c_HtmlNamePaleTurquoise[] PROGMEM = "paleturquoise"; -const char c_HtmlNamePaleVioletRed[] PROGMEM = "palevioletred"; -const char c_HtmlNamePapayaWhip[] PROGMEM = "papayawhip"; -const char c_HtmlNamePeachPuff[] PROGMEM = "peachpuff"; -const char c_HtmlNamePeru[] PROGMEM = "peru"; -const char c_HtmlNamePink[] PROGMEM = "pink"; -const char c_HtmlNamePlum[] PROGMEM = "plum"; -const char c_HtmlNamePowderBlue[] PROGMEM = "powderblue"; -const char c_HtmlNameRosyBrown[] PROGMEM = "rosybrown"; -const char c_HtmlNameRoyalBlue[] PROGMEM = "royalblue"; -const char c_HtmlNameSaddleBrown[] PROGMEM = "saddlebrown"; -const char c_HtmlNameSalmon[] PROGMEM = "salmon"; -const char c_HtmlNameSandyBrown[] PROGMEM = "sandybrown"; -const char c_HtmlNameSeaGreen[] PROGMEM = "seagreen"; -const char c_HtmlNameSeaShell[] PROGMEM = "seashell"; -const char c_HtmlNameSienna[] PROGMEM = "sienna"; -const char c_HtmlNameSkyBlue[] PROGMEM = "skyblue"; -const char c_HtmlNameSlateBlue[] PROGMEM = "slateblue"; -const char c_HtmlNameSlateGray[] PROGMEM = "slategray"; -const char c_HtmlNameSlateGrey[] PROGMEM = "slategrey"; -const char c_HtmlNameSnow[] PROGMEM = "snow"; -const char c_HtmlNameSpringGreen[] PROGMEM = "springgreen"; -const char c_HtmlNameSteelBlue[] PROGMEM = "steelblue"; -const char c_HtmlNameTan[] PROGMEM = "tan"; -const char c_HtmlNameThistle[] PROGMEM = "thistle"; -const char c_HtmlNameTomato[] PROGMEM = "tomato"; -const char c_HtmlNameTurquoise[] PROGMEM = "turquoise"; -const char c_HtmlNameViolet[] PROGMEM = "violet"; -const char c_HtmlNameWheat[] PROGMEM = "wheat"; -const char c_HtmlNameWhiteSmoke[] PROGMEM = "whitesmoke"; -const char c_HtmlNameYellowGreen[] PROGMEM = "yellowgreen"; \ No newline at end of file diff --git a/src/internal/HtmlColorNameStrings.h b/src/internal/HtmlColorNameStrings.h deleted file mode 100644 index 86ffcf4..0000000 --- a/src/internal/HtmlColorNameStrings.h +++ /dev/null @@ -1,180 +0,0 @@ -/*------------------------------------------------------------------------- -HtmlColorNameStrings provides the declaration of the color string names - -Written by Michael C. Miller. - -I invest time and resources providing this open source code, -please support me by dontating (see https://github.com/Makuna/NeoPixelBus) - -------------------------------------------------------------------------- -This file is part of the Makuna/NeoPixelBus library. - -NeoPixelBus is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as -published by the Free Software Foundation, either version 3 of -the License, or (at your option) any later version. - -NeoPixelBus is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with NeoPixel. If not, see -. --------------------------------------------------------------------------*/ - -#pragma once - -#include - -/* HTML4 color names */ -extern const char c_HtmlNameAqua[] PROGMEM; -extern const char c_HtmlNameBlack[] PROGMEM; -extern const char c_HtmlNameBlue[] PROGMEM; -extern const char c_HtmlNameFuchsia[] PROGMEM; -extern const char c_HtmlNameGray[] PROGMEM; -extern const char c_HtmlNameGreen[] PROGMEM; -extern const char c_HtmlNameLime[] PROGMEM; -extern const char c_HtmlNameMaroon[] PROGMEM; -extern const char c_HtmlNameNavy[] PROGMEM; -extern const char c_HtmlNameOlive[] PROGMEM; -extern const char c_HtmlNameOrange[] PROGMEM; -extern const char c_HtmlNamePurple[] PROGMEM; -extern const char c_HtmlNameRed[] PROGMEM; -extern const char c_HtmlNameSilver[] PROGMEM; -extern const char c_HtmlNameTeal[] PROGMEM; -extern const char c_HtmlNameWhite[] PROGMEM; -extern const char c_HtmlNameYellow[] PROGMEM; - -/* Additional CSS3 color names */ -extern const char c_HtmlNameAliceBlue[] PROGMEM; -extern const char c_HtmlNameAntiqueWhite[] PROGMEM; -extern const char c_HtmlNameAquamarine[] PROGMEM; -extern const char c_HtmlNameAzure[] PROGMEM; -extern const char c_HtmlNameBeige[] PROGMEM; -extern const char c_HtmlNameBisque[] PROGMEM; -extern const char c_HtmlNameBlanchedAlmond[] PROGMEM; -extern const char c_HtmlNameBlueViolet[] PROGMEM; -extern const char c_HtmlNameBrown[] PROGMEM; -extern const char c_HtmlNameBurlyWood[] PROGMEM; -extern const char c_HtmlNameCadetBlue[] PROGMEM; -extern const char c_HtmlNameChartreuse[] PROGMEM; -extern const char c_HtmlNameChocolate[] PROGMEM; -extern const char c_HtmlNameCoral[] PROGMEM; -extern const char c_HtmlNameCornflowerBlue[] PROGMEM; -extern const char c_HtmlNameCornsilk[] PROGMEM; -extern const char c_HtmlNameCrimson[] PROGMEM; -extern const char c_HtmlNameCyan[] PROGMEM; -extern const char c_HtmlNameDarkBlue[] PROGMEM; -extern const char c_HtmlNameDarkCyan[] PROGMEM; -extern const char c_HtmlNameDarkGoldenrod[] PROGMEM; -extern const char c_HtmlNameDarkGray[] PROGMEM; -extern const char c_HtmlNameDarkGreen[] PROGMEM; -extern const char c_HtmlNameDarkGrey[] PROGMEM; -extern const char c_HtmlNameDarkKhaki[] PROGMEM; -extern const char c_HtmlNameDarkMagenta[] PROGMEM; -extern const char c_HtmlNameDarkOliveGreen[] PROGMEM; -extern const char c_HtmlNameDarkOrange[] PROGMEM; -extern const char c_HtmlNameDarkOrchid[] PROGMEM; -extern const char c_HtmlNameDarkRed[] PROGMEM; -extern const char c_HtmlNameDarkSalmon[] PROGMEM; -extern const char c_HtmlNameDarkSeaGreen[] PROGMEM; -extern const char c_HtmlNameDarkSlateBlue[] PROGMEM; -extern const char c_HtmlNameDarkSlateGray[] PROGMEM; -extern const char c_HtmlNameDarkSlateGrey[] PROGMEM; -extern const char c_HtmlNameDarkTurquoise[] PROGMEM; -extern const char c_HtmlNameDarkViolet[] PROGMEM; -extern const char c_HtmlNameDeepPink[] PROGMEM; -extern const char c_HtmlNameDeepSkyBlue[] PROGMEM; -extern const char c_HtmlNameDimGray[] PROGMEM; -extern const char c_HtmlNameDimGrey[] PROGMEM; -extern const char c_HtmlNameDodgerBlue[] PROGMEM; -extern const char c_HtmlNameFirebrick[] PROGMEM; -extern const char c_HtmlNameFloralWhite[] PROGMEM; -extern const char c_HtmlNameForestGreen[] PROGMEM; -extern const char c_HtmlNameGainsboro[] PROGMEM; -extern const char c_HtmlNameGhostWhite[] PROGMEM; -extern const char c_HtmlNameGold[] PROGMEM; -extern const char c_HtmlNameGoldenrod[] PROGMEM; -extern const char c_HtmlNameGreenYellow[] PROGMEM; -extern const char c_HtmlNameGrey[] PROGMEM; -extern const char c_HtmlNameHoneydew[] PROGMEM; -extern const char c_HtmlNameHotPink[] PROGMEM; -extern const char c_HtmlNameIndianRed[] PROGMEM; -extern const char c_HtmlNameIndigo[] PROGMEM; -extern const char c_HtmlNameIvory[] PROGMEM; -extern const char c_HtmlNameKhaki[] PROGMEM; -extern const char c_HtmlNameLavender[] PROGMEM; -extern const char c_HtmlNameLavenderBlush[] PROGMEM; -extern const char c_HtmlNameLawnGreen[] PROGMEM; -extern const char c_HtmlNameLemonChiffon[] PROGMEM; -extern const char c_HtmlNameLightBlue[] PROGMEM; -extern const char c_HtmlNameLightCoral[] PROGMEM; -extern const char c_HtmlNameLightCyan[] PROGMEM; -extern const char c_HtmlNameLightGoldenrodYellow[] PROGMEM; -extern const char c_HtmlNameLightGray[] PROGMEM; -extern const char c_HtmlNameLightGreen[] PROGMEM; -extern const char c_HtmlNameLightGrey[] PROGMEM; -extern const char c_HtmlNameLightPink[] PROGMEM; -extern const char c_HtmlNameLightSalmon[] PROGMEM; -extern const char c_HtmlNameLightSeaGreen[] PROGMEM; -extern const char c_HtmlNameLightSkyBlue[] PROGMEM; -extern const char c_HtmlNameLightSlateGray[] PROGMEM; -extern const char c_HtmlNameLightSlateGrey[] PROGMEM; -extern const char c_HtmlNameLightSteelBlue[] PROGMEM; -extern const char c_HtmlNameLightYellow[] PROGMEM; -extern const char c_HtmlNameLimeGreen[] PROGMEM; -extern const char c_HtmlNameLinen[] PROGMEM; -extern const char c_HtmlNameMagenta[] PROGMEM; -extern const char c_HtmlNameMediumAquamarine[] PROGMEM; -extern const char c_HtmlNameMediumBlue[] PROGMEM; -extern const char c_HtmlNameMediumOrchid[] PROGMEM; -extern const char c_HtmlNameMediumPurple[] PROGMEM; -extern const char c_HtmlNameMediumSeagreen[] PROGMEM; -extern const char c_HtmlNameMediumSlateBlue[] PROGMEM; -extern const char c_HtmlNameMediumSpringGreen[] PROGMEM; -extern const char c_HtmlNameMediumTurquoise[] PROGMEM; -extern const char c_HtmlNameMediumVioletRed[] PROGMEM; -extern const char c_HtmlNameMidnightBlue[] PROGMEM; -extern const char c_HtmlNameMintCream[] PROGMEM; -extern const char c_HtmlNameMistyRose[] PROGMEM; -extern const char c_HtmlNameMoccasin[] PROGMEM; -extern const char c_HtmlNameNavajoWhite[] PROGMEM; -extern const char c_HtmlNameOldLace[] PROGMEM; -extern const char c_HtmlNameOliveDrab[] PROGMEM; -extern const char c_HtmlNameOrangeRed[] PROGMEM; -extern const char c_HtmlNameOrchid[] PROGMEM; -extern const char c_HtmlNamePaleGoldenrod[] PROGMEM; -extern const char c_HtmlNamePaleGreen[] PROGMEM; -extern const char c_HtmlNamePaleTurquoise[] PROGMEM; -extern const char c_HtmlNamePaleVioletRed[] PROGMEM; -extern const char c_HtmlNamePapayaWhip[] PROGMEM; -extern const char c_HtmlNamePeachPuff[] PROGMEM; -extern const char c_HtmlNamePeru[] PROGMEM; -extern const char c_HtmlNamePink[] PROGMEM; -extern const char c_HtmlNamePlum[] PROGMEM; -extern const char c_HtmlNamePowderBlue[] PROGMEM; -extern const char c_HtmlNameRosyBrown[] PROGMEM; -extern const char c_HtmlNameRoyalBlue[] PROGMEM; -extern const char c_HtmlNameSaddleBrown[] PROGMEM; -extern const char c_HtmlNameSalmon[] PROGMEM; -extern const char c_HtmlNameSandyBrown[] PROGMEM; -extern const char c_HtmlNameSeaGreen[] PROGMEM; -extern const char c_HtmlNameSeaShell[] PROGMEM; -extern const char c_HtmlNameSienna[] PROGMEM; -extern const char c_HtmlNameSkyBlue[] PROGMEM; -extern const char c_HtmlNameSlateBlue[] PROGMEM; -extern const char c_HtmlNameSlateGray[] PROGMEM; -extern const char c_HtmlNameSlateGrey[] PROGMEM; -extern const char c_HtmlNameSnow[] PROGMEM; -extern const char c_HtmlNameSpringGreen[] PROGMEM; -extern const char c_HtmlNameSteelBlue[] PROGMEM; -extern const char c_HtmlNameTan[] PROGMEM; -extern const char c_HtmlNameThistle[] PROGMEM; -extern const char c_HtmlNameTomato[] PROGMEM; -extern const char c_HtmlNameTurquoise[] PROGMEM; -extern const char c_HtmlNameViolet[] PROGMEM; -extern const char c_HtmlNameWheat[] PROGMEM; -extern const char c_HtmlNameWhiteSmoke[] PROGMEM; -extern const char c_HtmlNameYellowGreen[] PROGMEM; \ No newline at end of file diff --git a/src/internal/HtmlColorNames.cpp b/src/internal/HtmlColorNames.cpp deleted file mode 100644 index b1098ea..0000000 --- a/src/internal/HtmlColorNames.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/*------------------------------------------------------------------------- -HtmlColorNames provides a template class for access to the full name table - -Written by Michael C. Miller. - -I invest time and resources providing this open source code, -please support me by dontating (see https://github.com/Makuna/NeoPixelBus) - -------------------------------------------------------------------------- -This file is part of the Makuna/NeoPixelBus library. - -NeoPixelBus is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as -published by the Free Software Foundation, either version 3 of -the License, or (at your option) any later version. - -NeoPixelBus is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with NeoPixel. If not, see -. --------------------------------------------------------------------------*/ - -#include "HtmlColor.h" -#include "HtmlColorNameStrings.h" - -static const HtmlColorPair c_ColorNames[] PROGMEM = { - { c_HtmlNameAliceBlue, 0xf0f8ff }, - { c_HtmlNameAntiqueWhite, 0xfaebd7 }, - { c_HtmlNameAqua, 0xffff }, - { c_HtmlNameAquamarine, 0x7fffd4 }, - { c_HtmlNameAzure, 0xf0ffff }, - { c_HtmlNameBeige, 0xf5f5dc }, - { c_HtmlNameBisque, 0xffe4c4 }, - { c_HtmlNameBlack, 0x0 }, - { c_HtmlNameBlanchedAlmond, 0xffebcd }, - { c_HtmlNameBlue, 0xff }, - { c_HtmlNameBlueViolet, 0x8a2be2 }, - { c_HtmlNameBrown, 0xa52a2a }, - { c_HtmlNameBurlyWood, 0xdeb887 }, - { c_HtmlNameCadetBlue, 0x5f9ea0 }, - { c_HtmlNameChartreuse, 0x7fff00 }, - { c_HtmlNameChocolate, 0xd2691e }, - { c_HtmlNameCoral, 0xff7f50 }, - { c_HtmlNameCornflowerBlue, 0x6495ed }, - { c_HtmlNameCornsilk, 0xfff8dc }, - { c_HtmlNameCrimson, 0xdc143c }, - { c_HtmlNameCyan, 0xffff }, - { c_HtmlNameDarkBlue, 0x8b }, - { c_HtmlNameDarkCyan, 0x8b8b }, - { c_HtmlNameDarkGoldenrod, 0xb8860b }, - { c_HtmlNameDarkGray, 0xa9a9a9 }, - { c_HtmlNameDarkGreen, 0x6400 }, - { c_HtmlNameDarkGrey, 0xa9a9a9 }, - { c_HtmlNameDarkKhaki, 0xbdb76b }, - { c_HtmlNameDarkMagenta, 0x8b008b }, - { c_HtmlNameDarkOliveGreen, 0x556b2f }, - { c_HtmlNameDarkOrange, 0xff8c00 }, - { c_HtmlNameDarkOrchid, 0x9932cc }, - { c_HtmlNameDarkRed, 0x8b0000 }, - { c_HtmlNameDarkSalmon, 0xe9967a }, - { c_HtmlNameDarkSeaGreen, 0x8fbc8f }, - { c_HtmlNameDarkSlateBlue, 0x483d8b }, - { c_HtmlNameDarkSlateGray, 0x2f4f4f }, - { c_HtmlNameDarkSlateGrey, 0x2f4f4f }, - { c_HtmlNameDarkTurquoise, 0xced1 }, - { c_HtmlNameDarkViolet, 0x9400d3 }, - { c_HtmlNameDeepPink, 0xff1493 }, - { c_HtmlNameDeepSkyBlue, 0xbfff }, - { c_HtmlNameDimGray, 0x696969 }, - { c_HtmlNameDimGrey, 0x696969 }, - { c_HtmlNameDodgerBlue, 0x1e90ff }, - { c_HtmlNameFirebrick, 0xb22222 }, - { c_HtmlNameFloralWhite, 0xfffaf0 }, - { c_HtmlNameForestGreen, 0x228b22 }, - { c_HtmlNameFuchsia, 0xff00ff }, - { c_HtmlNameGainsboro, 0xdcdcdc }, - { c_HtmlNameGhostWhite, 0xf8f8ff }, - { c_HtmlNameGold, 0xffd700 }, - { c_HtmlNameGoldenrod, 0xdaa520 }, - { c_HtmlNameGray, 0x808080 }, - { c_HtmlNameGreen, 0x8000 }, - { c_HtmlNameGreenYellow, 0xadff2f }, - { c_HtmlNameGrey, 0x808080 }, - { c_HtmlNameHoneydew, 0xf0fff0 }, - { c_HtmlNameHotPink, 0xff69b4 }, - { c_HtmlNameIndianRed, 0xcd5c5c }, - { c_HtmlNameIndigo, 0x4b0082 }, - { c_HtmlNameIvory, 0xfffff0 }, - { c_HtmlNameKhaki, 0xf0e68c }, - { c_HtmlNameLavender, 0xe6e6fa }, - { c_HtmlNameLavenderBlush, 0xfff0f5 }, - { c_HtmlNameLawnGreen, 0x7cfc00 }, - { c_HtmlNameLemonChiffon, 0xfffacd }, - { c_HtmlNameLightBlue, 0xadd8e6 }, - { c_HtmlNameLightCoral, 0xf08080 }, - { c_HtmlNameLightCyan, 0xe0ffff }, - { c_HtmlNameLightGoldenrodYellow, 0xfafad2 }, - { c_HtmlNameLightGray, 0xd3d3d3 }, - { c_HtmlNameLightGreen, 0x90ee90 }, - { c_HtmlNameLightGrey, 0xd3d3d3 }, - { c_HtmlNameLightPink, 0xffb6c1 }, - { c_HtmlNameLightSalmon, 0xffa07a }, - { c_HtmlNameLightSeaGreen, 0x20b2aa }, - { c_HtmlNameLightSkyBlue, 0x87cefa }, - { c_HtmlNameLightSlateGray, 0x778899 }, - { c_HtmlNameLightSlateGrey, 0x778899 }, - { c_HtmlNameLightSteelBlue, 0xb0c4de }, - { c_HtmlNameLightYellow, 0xffffe0 }, - { c_HtmlNameLime, 0xff00 }, - { c_HtmlNameLimeGreen, 0x32cd32 }, - { c_HtmlNameLinen, 0xfaf0e6 }, - { c_HtmlNameMagenta, 0xff00ff }, - { c_HtmlNameMaroon, 0x800000 }, - { c_HtmlNameMediumAquamarine, 0x66cdaa }, - { c_HtmlNameMediumBlue, 0xcd }, - { c_HtmlNameMediumOrchid, 0xba55d3 }, - { c_HtmlNameMediumPurple, 0x9370d8 }, - { c_HtmlNameMediumSeagreen, 0x3cb371 }, - { c_HtmlNameMediumSlateBlue, 0x7b68ee }, - { c_HtmlNameMediumSpringGreen, 0xfa9a }, - { c_HtmlNameMediumTurquoise, 0x48d1cc }, - { c_HtmlNameMediumVioletRed, 0xc71585 }, - { c_HtmlNameMidnightBlue, 0x191970 }, - { c_HtmlNameMintCream, 0xf5fffa }, - { c_HtmlNameMistyRose, 0xffe4e1 }, - { c_HtmlNameMoccasin, 0xffe4b5 }, - { c_HtmlNameNavajoWhite, 0xffdead }, - { c_HtmlNameNavy, 0x80 }, - { c_HtmlNameOldLace, 0xfdf5e6 }, - { c_HtmlNameOlive, 0x808000 }, - { c_HtmlNameOliveDrab, 0x6b8e23 }, - { c_HtmlNameOrange, 0xffa500 }, - { c_HtmlNameOrangeRed, 0xff4500 }, - { c_HtmlNameOrchid, 0xda70d6 }, - { c_HtmlNamePaleGoldenrod, 0xeee8aa }, - { c_HtmlNamePaleGreen, 0x98fb98 }, - { c_HtmlNamePaleTurquoise, 0xafeeee }, - { c_HtmlNamePaleVioletRed, 0xd87093 }, - { c_HtmlNamePapayaWhip, 0xffefd5 }, - { c_HtmlNamePeachPuff, 0xffdab9 }, - { c_HtmlNamePeru, 0xcd853f }, - { c_HtmlNamePink, 0xffc0cb }, - { c_HtmlNamePlum, 0xdda0dd }, - { c_HtmlNamePowderBlue, 0xb0e0e6 }, - { c_HtmlNamePurple, 0x800080 }, - { c_HtmlNameRed, 0xff0000 }, - { c_HtmlNameRosyBrown, 0xbc8f8f }, - { c_HtmlNameRoyalBlue, 0x4169e1 }, - { c_HtmlNameSaddleBrown, 0x8b4513 }, - { c_HtmlNameSalmon, 0xfa8072 }, - { c_HtmlNameSandyBrown, 0xf4a460 }, - { c_HtmlNameSeaGreen, 0x2e8b57 }, - { c_HtmlNameSeaShell, 0xfff5ee }, - { c_HtmlNameSienna, 0xa0522d }, - { c_HtmlNameSilver, 0xc0c0c0 }, - { c_HtmlNameSkyBlue, 0x87ceeb }, - { c_HtmlNameSlateBlue, 0x6a5acd }, - { c_HtmlNameSlateGray, 0x708090 }, - { c_HtmlNameSlateGrey, 0x708090 }, - { c_HtmlNameSnow, 0xfffafa }, - { c_HtmlNameSpringGreen, 0xff7f }, - { c_HtmlNameSteelBlue, 0x4682b4 }, - { c_HtmlNameTan, 0xd2b48c }, - { c_HtmlNameTeal, 0x8080 }, - { c_HtmlNameThistle, 0xd8bfd8 }, - { c_HtmlNameTomato, 0xff6347 }, - { c_HtmlNameTurquoise, 0x40e0d0 }, - { c_HtmlNameViolet, 0xee82ee }, - { c_HtmlNameWheat, 0xf5deb3 }, - { c_HtmlNameWhite, 0xffffff }, - { c_HtmlNameWhiteSmoke, 0xf5f5f5 }, - { c_HtmlNameYellow, 0xffff00 }, - { c_HtmlNameYellowGreen, 0x9acd32 }, -}; - -const HtmlColorPair* HtmlColorNames::Pair(uint8_t index) -{ - return &c_ColorNames[index]; -} - -uint8_t HtmlColorNames::Count() -{ - return countof(c_ColorNames); -} diff --git a/src/internal/HtmlColorShortNames.cpp b/src/internal/HtmlColorShortNames.cpp deleted file mode 100644 index 3c4e27c..0000000 --- a/src/internal/HtmlColorShortNames.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/*------------------------------------------------------------------------- -HtmlShortColorNames provides a template class for access to the short name table - -Written by Michael C. Miller. - -I invest time and resources providing this open source code, -please support me by dontating (see https://github.com/Makuna/NeoPixelBus) - -------------------------------------------------------------------------- -This file is part of the Makuna/NeoPixelBus library. - -NeoPixelBus is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as -published by the Free Software Foundation, either version 3 of -the License, or (at your option) any later version. - -NeoPixelBus is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with NeoPixel. If not, see -. --------------------------------------------------------------------------*/ - -#include "HtmlColor.h" -#include "HtmlColorNameStrings.h" - -static const HtmlColorPair c_ShortColorNames[] PROGMEM = { - { c_HtmlNameAqua, 0xffff }, - { c_HtmlNameBlack, 0x0 }, - { c_HtmlNameBlue, 0xff }, - { c_HtmlNameFuchsia, 0xff00ff }, - { c_HtmlNameGray, 0x808080 }, - { c_HtmlNameGreen, 0x8000 }, - { c_HtmlNameLime, 0xff00 }, - { c_HtmlNameMaroon, 0x800000 }, - { c_HtmlNameNavy, 0x80 }, - { c_HtmlNameOlive, 0x808000 }, - { c_HtmlNameOrange, 0xffa500 }, - { c_HtmlNamePurple, 0x800080 }, - { c_HtmlNameRed, 0xff0000 }, - { c_HtmlNameSilver, 0xc0c0c0 }, - { c_HtmlNameTeal, 0x8080 }, - { c_HtmlNameWhite, 0xffffff }, - { c_HtmlNameYellow, 0xffff00 }, -}; - - -const HtmlColorPair* HtmlShortColorNames::Pair(uint8_t index) -{ - return &c_ShortColorNames[index]; -} - -uint8_t HtmlShortColorNames::Count() -{ - return countof(c_ShortColorNames); -} \ No newline at end of file diff --git a/src/internal/Lpd8806ColorFeatures.h b/src/internal/Lpd8806ColorFeatures.h index 6ffb4d0..7bb8a75 100644 --- a/src/internal/Lpd8806ColorFeatures.h +++ b/src/internal/Lpd8806ColorFeatures.h @@ -84,18 +84,6 @@ public: } } - static void movePixelsInc_P(uint8_t* pPixelDest, PGM_VOID_P pPixelSrc, uint16_t count) - { - uint8_t* pEnd = pPixelDest + (count * PixelSize); - const uint8_t* pSrc = (const uint8_t*)pPixelSrc; - while (pPixelDest < pEnd) - { - *pPixelDest++ = pgm_read_byte(pSrc++); - *pPixelDest++ = pgm_read_byte(pSrc++); - *pPixelDest++ = pgm_read_byte(pSrc++); - } - } - static void movePixelsDec(uint8_t* pPixelDest, const uint8_t* pPixelSrc, uint16_t count) { uint8_t* pDestBack = pPixelDest + (count * PixelSize); @@ -134,19 +122,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.B = (pgm_read_byte(p++)) << 1; - color.R = (pgm_read_byte(p++)) << 1; - color.G = (pgm_read_byte(p)) << 1; - - return color; - } - }; class Lpd8806GrbFeature : public Lpd88063Elements @@ -172,18 +147,5 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.G = (pgm_read_byte(p++)) << 1; - color.R = (pgm_read_byte(p++)) << 1; - color.B = (pgm_read_byte(p)) << 1; - - return color; - } - }; diff --git a/src/internal/NeoColorFeatures.h b/src/internal/NeoColorFeatures.h index d1494a2..1f7ec16 100644 --- a/src/internal/NeoColorFeatures.h +++ b/src/internal/NeoColorFeatures.h @@ -61,16 +61,6 @@ public: } } - static void movePixelsInc_P(uint8_t* pPixelDest, PGM_VOID_P pPixelSrc, uint16_t count) - { - uint8_t* pEnd = pPixelDest + (count * PixelSize); - const uint8_t* pSrc = (const uint8_t*)pPixelSrc; - while (pPixelDest < pEnd) - { - *pPixelDest++ = pgm_read_byte(pSrc++); - } - } - static void movePixelsDec(uint8_t* pPixelDest, const uint8_t* pPixelSrc, uint16_t count) { uint8_t* pDestBack = pPixelDest + (count * PixelSize); @@ -121,17 +111,6 @@ public: } } - static void movePixelsInc_P(uint8_t* pPixelDest, PGM_VOID_P pPixelSrc, uint16_t count) - { - uint32_t* pDest = (uint32_t*)pPixelDest; - const uint32_t* pSrc = (const uint32_t*)pPixelSrc; - uint32_t* pEnd = pDest + count; - while (pDest < pEnd) - { - *pDest++ = pgm_read_dword(pSrc++); - } - } - static void movePixelsDec(uint8_t* pPixelDest, const uint8_t* pPixelSrc, uint16_t count) { uint32_t* pDest = (uint32_t*)pPixelDest; @@ -212,20 +191,7 @@ public: color.B = *p; return color; - } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.G = pgm_read_byte(p++); - color.R = pgm_read_byte(p++); - color.B = pgm_read_byte(p); - - return color; - } - + } }; class NeoGrbwFeature : public Neo4ElementsNoSettings @@ -254,20 +220,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.G = pgm_read_byte(p++); - color.R = pgm_read_byte(p++); - color.B = pgm_read_byte(p++); - color.W = pgm_read_byte(p); - - return color; - } - }; class NeoRgbwFeature : public Neo4ElementsNoSettings @@ -295,20 +247,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.R = pgm_read_byte(p++); - color.G = pgm_read_byte(p++); - color.B = pgm_read_byte(p++); - color.W = pgm_read_byte(p); - - return color; - } - }; class NeoRgbFeature : public Neo3ElementsNoSettings @@ -334,19 +272,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.R = pgm_read_byte(p++); - color.G = pgm_read_byte(p++); - color.B = pgm_read_byte(p); - - return color; - } - }; class NeoBrgFeature : public Neo3ElementsNoSettings @@ -372,19 +297,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.B = pgm_read_byte(p++); - color.R = pgm_read_byte(p++); - color.G = pgm_read_byte(p); - - return color; - } - }; class NeoRbgFeature : public Neo3ElementsNoSettings @@ -410,18 +322,4 @@ public: return color; } - - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.R = pgm_read_byte(p++); - color.B = pgm_read_byte(p++); - color.G = pgm_read_byte(p); - - return color; - } - }; diff --git a/src/internal/NeoSegmentFeatures.h b/src/internal/NeoSegmentFeatures.h index f0118f6..ee05f3f 100644 --- a/src/internal/NeoSegmentFeatures.h +++ b/src/internal/NeoSegmentFeatures.h @@ -61,16 +61,6 @@ public: } } - static void movePixelsInc_P(uint8_t* pPixelDest, PGM_VOID_P pPixelSrc, uint16_t count) - { - uint8_t* pEnd = pPixelDest + (count * PixelSize); - const uint8_t* pSrc = (const uint8_t*)pPixelSrc; - while (pPixelDest < pEnd) - { - *pPixelDest++ = pgm_read_byte(pSrc++); - } - } - static void movePixelsDec(uint8_t* pPixelDest, const uint8_t* pPixelSrc, uint16_t count) { uint8_t* pDestBack = pPixelDest + (count * PixelSize); @@ -110,21 +100,6 @@ public: } return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - uint8_t commonSize = (PixelSize < color.SegmentCount) ? PixelSize : color.SegmentCount; - - for (uint8_t iSegment = 0; iSegment < commonSize; iSegment++) - { - color.Segment[iSegment] = pgm_read_byte(p++); - } - - return color; - } - }; -typedef NeoAbcdefgSegmentFeature SevenSegmentFeature; // Abcdefg order is default \ No newline at end of file +typedef NeoAbcdefgSegmentFeature SevenSegmentFeature; // Abcdefg order is default diff --git a/src/internal/NeoTm1814ColorFeatures.h b/src/internal/NeoTm1814ColorFeatures.h index bc5035f..a6abeb0 100644 --- a/src/internal/NeoTm1814ColorFeatures.h +++ b/src/internal/NeoTm1814ColorFeatures.h @@ -113,19 +113,5 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - color.W = pgm_read_byte(p++); - color.R = pgm_read_byte(p++); - color.G = pgm_read_byte(p++); - color.B = pgm_read_byte(p); - - return color; - } - }; diff --git a/src/internal/P9813ColorFeatures.h b/src/internal/P9813ColorFeatures.h index 2212e1f..a2e196a 100644 --- a/src/internal/P9813ColorFeatures.h +++ b/src/internal/P9813ColorFeatures.h @@ -64,19 +64,6 @@ public: } } - static void movePixelsInc_P(uint8_t* pPixelDest, PGM_VOID_P pPixelSrc, uint16_t count) - { - uint8_t* pEnd = pPixelDest + (count * PixelSize); - const uint8_t* pSrc = (const uint8_t*)pPixelSrc; - while (pPixelDest < pEnd) - { - *pPixelDest++ = pgm_read_byte(pSrc++); - *pPixelDest++ = pgm_read_byte(pSrc++); - *pPixelDest++ = pgm_read_byte(pSrc++); - *pPixelDest++ = pgm_read_byte(pSrc++); - } - } - static void movePixelsDec(uint8_t* pPixelDest, const uint8_t* pPixelSrc, uint16_t count) { uint8_t* pDestBack = pPixelDest + (count * PixelSize); @@ -139,20 +126,6 @@ public: return color; } - - static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) - { - ColorObject color; - const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); - - pgm_read_byte(p++); // ignore the first byte - color.B = pgm_read_byte(p++); - color.G = pgm_read_byte(p++); - color.R = pgm_read_byte(p); - - return color; - } - }; diff --git a/src/internal/RgbColor.cpp b/src/internal/RgbColor.cpp index 30a7811..39371db 100644 --- a/src/internal/RgbColor.cpp +++ b/src/internal/RgbColor.cpp @@ -27,7 +27,6 @@ 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) { @@ -48,17 +47,6 @@ static float _CalcColor(float p, float q, float t) return p; } -RgbColor::RgbColor(const HtmlColor& color) -{ - uint32_t temp = color.Color; - - B = (temp & 0xff); - temp = temp >> 8; - G = (temp & 0xff); - temp = temp >> 8; - R = (temp & 0xff); -}; - RgbColor::RgbColor(const HslColor& color) { float r; @@ -258,4 +246,4 @@ RgbColor RgbColor::BilinearBlend(const RgbColor& c00, c00.R * v00 + c10.R * v10 + c01.R * v01 + c11.R * v11, c00.G * v00 + c10.G * v10 + c01.G * v01 + c11.G * v11, c00.B * v00 + c10.B * v10 + c01.B * v01 + c11.B * v11); -} \ No newline at end of file +} diff --git a/src/internal/RgbColor.h b/src/internal/RgbColor.h index b50857b..55b5618 100644 --- a/src/internal/RgbColor.h +++ b/src/internal/RgbColor.h @@ -30,7 +30,6 @@ License along with NeoPixel. If not, see struct HslColor; struct HsbColor; -struct HtmlColor; // ------------------------------------------------------------------------ // RgbColor represents a color object that is represented by Red, Green, Blue @@ -59,11 +58,6 @@ struct RgbColor { }; - // ------------------------------------------------------------------------ - // Construct a RgbColor using HtmlColor - // ------------------------------------------------------------------------ - RgbColor(const HtmlColor& color); - // ------------------------------------------------------------------------ // Construct a RgbColor using HslColor // ------------------------------------------------------------------------ diff --git a/src/internal/RgbwColor.cpp b/src/internal/RgbwColor.cpp index cb9681f..81d89ed 100644 --- a/src/internal/RgbwColor.cpp +++ b/src/internal/RgbwColor.cpp @@ -28,19 +28,6 @@ License along with NeoPixel. If not, see #include "HslColor.h" #include "HsbColor.h" #include "RgbwColor.h" -#include "HtmlColor.h" - -RgbwColor::RgbwColor(const HtmlColor& color) -{ - uint32_t temp = color.Color; - B = (temp & 0xff); - temp = temp >> 8; - G = (temp & 0xff); - temp = temp >> 8; - R = (temp & 0xff); - temp = temp >> 8; - W = (temp & 0xff); -}; RgbwColor::RgbwColor(const HslColor& color) { @@ -187,4 +174,4 @@ RgbwColor RgbwColor::BilinearBlend(const RgbwColor& c00, c00.G * v00 + c10.G * v10 + c01.G * v01 + c11.G * v11, c00.B * v00 + c10.B * v10 + c01.B * v01 + c11.B * v11, c00.W * v00 + c10.W * v10 + c01.W * v01 + c11.W * v11 ); -} \ No newline at end of file +} diff --git a/src/internal/RgbwColor.h b/src/internal/RgbwColor.h index 73732b5..e282223 100644 --- a/src/internal/RgbwColor.h +++ b/src/internal/RgbwColor.h @@ -69,11 +69,6 @@ struct RgbwColor { }; - // ------------------------------------------------------------------------ - // Construct a RgbwColor using HtmlColor - // ------------------------------------------------------------------------ - RgbwColor(const HtmlColor& color); - // ------------------------------------------------------------------------ // Construct a RgbwColor using HslColor // ------------------------------------------------------------------------