forked from Makuna/NeoPixelBus
1 parent
6e276ec337
commit
cf298d4096
10 files changed
+443
-105
No files matched your search
@@ -26,6 +26,7 @@ License along with NeoPixel. If not, see
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "NeoSettings.h"
|
||||
|
||||
struct HslColor;
|
||||
struct HsbColor;
|
||||
@@ -38,6 +39,8 @@ struct HtmlColor;
|
||||
// ------------------------------------------------------------------------
|
||||
struct RgbColor
|
||||
{
|
||||
typedef NeoRgbCurrentSettings SettingsObject;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Construct a RgbColor using R, G, B values (0-255)
|
||||
// ------------------------------------------------------------------------
|
||||
@@ -145,6 +148,17 @@ struct RgbColor
|
||||
float x,
|
||||
float y);
|
||||
|
||||
uint32_t CalcTotalTenthMilliAmpere(const SettingsObject& settings)
|
||||
{
|
||||
auto total = 0;
|
||||
|
||||
total += R * settings.RedTenthMilliAmpere / 255;
|
||||
total += G * settings.GreenTenthMilliAmpere / 255;
|
||||
total += B * settings.BlueTenthMilliAmpere / 255;
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Red, Green, Blue color members (0-255) where
|
||||
// (0,0,0) is black and (255,255,255) is white
|
||||
|
||||
Reference in new issue
Block a user