-
-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from Makuna/HtmlColorInit
HtmlColor Support
- Loading branch information
Showing
10 changed files
with
97 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name=NeoPixelBus by Makuna | ||
version=2.0.2 | ||
version=2.0.3 | ||
author=Michael C. Miller ([email protected]) | ||
maintainer=Michael C. Miller ([email protected]) | ||
sentence=A library that makes controlling NeoPixels (WS2811, WS2812 & SK6812) easy. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/*------------------------------------------------------------------------- | ||
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 | ||
<http://www.gnu.org/licenses/>. | ||
-------------------------------------------------------------------------*/ | ||
#pragma once | ||
|
||
#include <Arduino.h> | ||
#include "RgbColor.h" | ||
|
||
|
||
// ------------------------------------------------------------------------ | ||
// 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 = color.R << 16 | color.G << 8 | 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() | ||
{ | ||
}; | ||
|
||
|
||
// ------------------------------------------------------------------------ | ||
// Color member (0-0xffffff) where | ||
// 0xff0000 is red | ||
// 0x00ff00 is green | ||
// 0x0000ff is blue | ||
// ------------------------------------------------------------------------ | ||
uint32_t Color; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters