WPILibC++  2020.3.2-60-g3011ebe
frc::Color Class Reference

Represents colors that can be used with Addressable LEDs. More...

#include <Color.h>

Public Member Functions

constexpr Color (double r, double g, double b)
 Constructs a Color. More...
 

Static Public Member Functions

static constexpr Color FromHSV (int h, int s, int v)
 Creates a Color from HSV values. More...
 

Public Attributes

double red = 0.0
 
double green = 0.0
 
double blue = 0.0
 

Static Public Attributes

static const Color kDenim {0.0823529412, 0.376470589, 0.7411764706}
 #1560BD.
 
static const Color kFirstBlue {0.0, 0.4, 0.7019607844}
 #0066B3.
 
static const Color kFirstRed
 #ED1C24. More...
 
static const Color kAliceBlue {0.9411765f, 0.972549f, 1.0f}
 #F0F8FF.
 
static const Color kAntiqueWhite
 #FAEBD7. More...
 
static const Color kAqua {0.0f, 1.0f, 1.0f}
 #00FFFF.
 
static const Color kAquamarine {0.49803922f, 1.0f, 0.83137256f}
 #7FFFD4.
 
static const Color kAzure {0.9411765f, 1.0f, 1.0f}
 #F0FFFF.
 
static const Color kBeige {0.9607843f, 0.9607843f, 0.8627451f}
 #F5F5DC.
 
static const Color kBisque {1.0f, 0.89411765f, 0.76862746f}
 #FFE4C4.
 
static const Color kBlack {0.0f, 0.0f, 0.0f}
 #000000.
 
static const Color kBlanchedAlmond {1.0f, 0.92156863f, 0.8039216f}
 #FFEBCD.
 
static const Color kBlue {0.0f, 0.0f, 1.0f}
 #0000FF.
 
static const Color kBlueViolet {0.5411765f, 0.16862746f, 0.8862745f}
 #8A2BE2.
 
static const Color kBrown {0.64705884f, 0.16470589f, 0.16470589f}
 #A52A2A.
 
static const Color kBurlywood {0.87058824f, 0.72156864f, 0.5294118f}
 #DEB887.
 
static const Color kCadetBlue {0.37254903f, 0.61960787f, 0.627451f}
 #5F9EA0.
 
static const Color kChartreuse {0.49803922f, 1.0f, 0.0f}
 #7FFF00.
 
static const Color kChocolate {0.8235294f, 0.4117647f, 0.11764706f}
 #D2691E.
 
static const Color kCoral {1.0f, 0.49803922f, 0.3137255f}
 #FF7F50.
 
static const Color kCornflowerBlue
 #6495ED. More...
 
static const Color kCornsilk {1.0f, 0.972549f, 0.8627451f}
 #FFF8DC.
 
static const Color kCrimson {0.8627451f, 0.078431375f, 0.23529412f}
 #DC143C.
 
static const Color kCyan {0.0f, 1.0f, 1.0f}
 #00FFFF.
 
static const Color kDarkBlue {0.0f, 0.0f, 0.54509807f}
 #00008B.
 
static const Color kDarkCyan {0.0f, 0.54509807f, 0.54509807f}
 #008B8B.
 
static const Color kDarkGoldenrod
 #B8860B. More...
 
static const Color kDarkGray {0.6627451f, 0.6627451f, 0.6627451f}
 #A9A9A9.
 
static const Color kDarkGreen {0.0f, 0.39215687f, 0.0f}
 #006400.
 
static const Color kDarkKhaki {0.7411765f, 0.7176471f, 0.41960785f}
 #BDB76B.
 
static const Color kDarkMagenta {0.54509807f, 0.0f, 0.54509807f}
 #8B008B.
 
static const Color kDarkOliveGreen
 #556B2F. More...
 
static const Color kDarkOrange {1.0f, 0.54901963f, 0.0f}
 #FF8C00.
 
static const Color kDarkOrchid {0.6f, 0.19607843f, 0.8f}
 #9932CC.
 
static const Color kDarkRed {0.54509807f, 0.0f, 0.0f}
 #8B0000.
 
static const Color kDarkSalmon {0.9137255f, 0.5882353f, 0.47843137f}
 #E9967A.
 
static const Color kDarkSeaGreen
 #8FBC8F. More...
 
static const Color kDarkSlateBlue
 #483D8B. More...
 
static const Color kDarkSlateGray
 #2F4F4F. More...
 
static const Color kDarkTurquoise {0.0f, 0.80784315f, 0.81960785f}
 #00CED1.
 
static const Color kDarkViolet {0.5803922f, 0.0f, 0.827451f}
 #9400D3.
 
static const Color kDeepPink {1.0f, 0.078431375f, 0.5764706f}
 #FF1493.
 
static const Color kDeepSkyBlue {0.0f, 0.7490196f, 1.0f}
 #00BFFF.
 
static const Color kDimGray {0.4117647f, 0.4117647f, 0.4117647f}
 #696969.
 
static const Color kDodgerBlue {0.11764706f, 0.5647059f, 1.0f}
 #1E90FF.
 
static const Color kFirebrick {0.69803923f, 0.13333334f, 0.13333334f}
 #B22222.
 
static const Color kFloralWhite {1.0f, 0.98039216f, 0.9411765f}
 #FFFAF0.
 
static const Color kForestGreen
 #228B22. More...
 
static const Color kFuchsia {1.0f, 0.0f, 1.0f}
 #FF00FF.
 
static const Color kGainsboro {0.8627451f, 0.8627451f, 0.8627451f}
 #DCDCDC.
 
static const Color kGhostWhite {0.972549f, 0.972549f, 1.0f}
 #F8F8FF.
 
static const Color kGold {1.0f, 0.84313726f, 0.0f}
 #FFD700.
 
static const Color kGoldenrod {0.85490197f, 0.64705884f, 0.1254902f}
 #DAA520.
 
static const Color kGray {0.5019608f, 0.5019608f, 0.5019608f}
 #808080.
 
static const Color kGreen {0.0f, 0.5019608f, 0.0f}
 #008000.
 
static const Color kGreenYellow {0.6784314f, 1.0f, 0.18431373f}
 #ADFF2F.
 
static const Color kHoneydew {0.9411765f, 1.0f, 0.9411765f}
 #F0FFF0.
 
static const Color kHotPink {1.0f, 0.4117647f, 0.7058824f}
 #FF69B4.
 
static const Color kIndianRed {0.8039216f, 0.36078432f, 0.36078432f}
 #CD5C5C.
 
static const Color kIndigo {0.29411766f, 0.0f, 0.50980395f}
 #4B0082.
 
static const Color kIvory {1.0f, 1.0f, 0.9411765f}
 #FFFFF0.
 
static const Color kKhaki {0.9411765f, 0.9019608f, 0.54901963f}
 #F0E68C.
 
static const Color kLavender {0.9019608f, 0.9019608f, 0.98039216f}
 #E6E6FA.
 
static const Color kLavenderBlush {1.0f, 0.9411765f, 0.9607843f}
 #FFF0F5.
 
static const Color kLawnGreen {0.4862745f, 0.9882353f, 0.0f}
 #7CFC00.
 
static const Color kLemonChiffon {1.0f, 0.98039216f, 0.8039216f}
 #FFFACD.
 
static const Color kLightBlue {0.6784314f, 0.84705883f, 0.9019608f}
 #ADD8E6.
 
static const Color kLightCoral {0.9411765f, 0.5019608f, 0.5019608f}
 #F08080.
 
static const Color kLightCyan {0.8784314f, 1.0f, 1.0f}
 #E0FFFF.
 
static const Color kLightGoldenrodYellow
 #FAFAD2. More...
 
static const Color kLightGray {0.827451f, 0.827451f, 0.827451f}
 #D3D3D3.
 
static const Color kLightGreen {0.5647059f, 0.93333334f, 0.5647059f}
 #90EE90.
 
static const Color kLightPink {1.0f, 0.7137255f, 0.75686276f}
 #FFB6C1.
 
static const Color kLightSalmon {1.0f, 0.627451f, 0.47843137f}
 #FFA07A.
 
static const Color kLightSeaGreen
 #20B2AA. More...
 
static const Color kLightSkyBlue
 #87CEFA. More...
 
static const Color kLightSlateGray {0.46666667f, 0.53333336f, 0.6f}
 #778899.
 
static const Color kLightSteelBlue
 #B0C4DE. More...
 
static const Color kLightYellow {1.0f, 1.0f, 0.8784314f}
 #FFFFE0.
 
static const Color kLime {0.0f, 1.0f, 0.0f}
 #00FF00.
 
static const Color kLimeGreen {0.19607843f, 0.8039216f, 0.19607843f}
 #32CD32.
 
static const Color kLinen {0.98039216f, 0.9411765f, 0.9019608f}
 #FAF0E6.
 
static const Color kMagenta {1.0f, 0.0f, 1.0f}
 #FF00FF.
 
static const Color kMaroon {0.5019608f, 0.0f, 0.0f}
 #800000.
 
static const Color kMediumAquamarine {0.4f, 0.8039216f, 0.6666667f}
 #66CDAA.
 
static const Color kMediumBlue {0.0f, 0.0f, 0.8039216f}
 #0000CD.
 
static const Color kMediumOrchid {0.7294118f, 0.33333334f, 0.827451f}
 #BA55D3.
 
static const Color kMediumPurple
 #9370DB. More...
 
static const Color kMediumSeaGreen
 #3CB371. More...
 
static const Color kMediumSlateBlue
 #7B68EE. More...
 
static const Color kMediumSpringGreen {0.0f, 0.98039216f, 0.6039216f}
 #00FA9A.
 
static const Color kMediumTurquoise {0.28235295f, 0.81960785f, 0.8f}
 #48D1CC.
 
static const Color kMediumVioletRed
 #C71585. More...
 
static const Color kMidnightBlue
 #191970. More...
 
static const Color kMintcream {0.9607843f, 1.0f, 0.98039216f}
 #F5FFFA.
 
static const Color kMistyRose {1.0f, 0.89411765f, 0.88235295f}
 #FFE4E1.
 
static const Color kMoccasin {1.0f, 0.89411765f, 0.70980394f}
 #FFE4B5.
 
static const Color kNavajoWhite {1.0f, 0.87058824f, 0.6784314f}
 #FFDEAD.
 
static const Color kNavy {0.0f, 0.0f, 0.5019608f}
 #000080.
 
static const Color kOldLace {0.99215686f, 0.9607843f, 0.9019608f}
 #FDF5E6.
 
static const Color kOlive {0.5019608f, 0.5019608f, 0.0f}
 #808000.
 
static const Color kOliveDrab {0.41960785f, 0.5568628f, 0.13725491f}
 #6B8E23.
 
static const Color kOrange {1.0f, 0.64705884f, 0.0f}
 #FFA500.
 
static const Color kOrangeRed {1.0f, 0.27058825f, 0.0f}
 #FF4500.
 
static const Color kOrchid {0.85490197f, 0.4392157f, 0.8392157f}
 #DA70D6.
 
static const Color kPaleGoldenrod
 #EEE8AA. More...
 
static const Color kPaleGreen {0.59607846f, 0.9843137f, 0.59607846f}
 #98FB98.
 
static const Color kPaleTurquoise
 #AFEEEE. More...
 
static const Color kPaleVioletRed
 #DB7093. More...
 
static const Color kPapayaWhip {1.0f, 0.9372549f, 0.8352941f}
 #FFEFD5.
 
static const Color kPeachPuff {1.0f, 0.85490197f, 0.7254902f}
 #FFDAB9.
 
static const Color kPeru {0.8039216f, 0.52156866f, 0.24705882f}
 #CD853F.
 
static const Color kPink {1.0f, 0.7529412f, 0.79607844f}
 #FFC0CB.
 
static const Color kPlum {0.8666667f, 0.627451f, 0.8666667f}
 #DDA0DD.
 
static const Color kPowderBlue {0.6901961f, 0.8784314f, 0.9019608f}
 #B0E0E6.
 
static const Color kPurple {0.5019608f, 0.0f, 0.5019608f}
 #800080.
 
static const Color kRed {1.0f, 0.0f, 0.0f}
 #FF0000.
 
static const Color kRosyBrown {0.7372549f, 0.56078434f, 0.56078434f}
 #BC8F8F.
 
static const Color kRoyalBlue {0.25490198f, 0.4117647f, 0.88235295f}
 #4169E1.
 
static const Color kSaddleBrown
 #8B4513. More...
 
static const Color kSalmon {0.98039216f, 0.5019608f, 0.44705883f}
 #FA8072.
 
static const Color kSandyBrown {0.95686275f, 0.6431373f, 0.3764706f}
 #F4A460.
 
static const Color kSeaGreen {0.18039216f, 0.54509807f, 0.34117648f}
 #2E8B57.
 
static const Color kSeashell {1.0f, 0.9607843f, 0.93333334f}
 #FFF5EE.
 
static const Color kSienna {0.627451f, 0.32156864f, 0.1764706f}
 #A0522D.
 
static const Color kSilver {0.7529412f, 0.7529412f, 0.7529412f}
 #C0C0C0.
 
static const Color kSkyBlue {0.5294118f, 0.80784315f, 0.92156863f}
 #87CEEB.
 
static const Color kSlateBlue {0.41568628f, 0.3529412f, 0.8039216f}
 #6A5ACD.
 
static const Color kSlateGray {0.4392157f, 0.5019608f, 0.5647059f}
 #708090.
 
static const Color kSnow {1.0f, 0.98039216f, 0.98039216f}
 #FFFAFA.
 
static const Color kSpringGreen {0.0f, 1.0f, 0.49803922f}
 #00FF7F.
 
static const Color kSteelBlue {0.27450982f, 0.50980395f, 0.7058824f}
 #4682B4.
 
static const Color kTan {0.8235294f, 0.7058824f, 0.54901963f}
 #D2B48C.
 
static const Color kTeal {0.0f, 0.5019608f, 0.5019608f}
 #008080.
 
static const Color kThistle {0.84705883f, 0.7490196f, 0.84705883f}
 #D8BFD8.
 
static const Color kTomato {1.0f, 0.3882353f, 0.2784314f}
 #FF6347.
 
static const Color kTurquoise {0.2509804f, 0.8784314f, 0.8156863f}
 #40E0D0.
 
static const Color kViolet {0.93333334f, 0.50980395f, 0.93333334f}
 #EE82EE.
 
static const Color kWheat {0.9607843f, 0.87058824f, 0.7019608f}
 #F5DEB3.
 
static const Color kWhite {1.0f, 1.0f, 1.0f}
 #FFFFFF.
 
static const Color kWhiteSmoke {0.9607843f, 0.9607843f, 0.9607843f}
 #F5F5F5.
 
static const Color kYellow {1.0f, 1.0f, 0.0f}
 #FFFF00.
 
static const Color kYellowGreen {0.6039216f, 0.8039216f, 0.19607843f}
 #9ACD32.
 

Detailed Description

Represents colors that can be used with Addressable LEDs.

Limited to 12 bits of precision.

Constructor & Destructor Documentation

◆ Color()

constexpr frc::Color::Color ( double  r,
double  g,
double  b 
)
inlineconstexpr

Constructs a Color.

Parameters
redRed value (0-1)
greenGreen value (0-1)
blueBlue value (0-1)

Member Function Documentation

◆ FromHSV()

static constexpr Color frc::Color::FromHSV ( int  h,
int  s,
int  v 
)
inlinestaticconstexpr

Creates a Color from HSV values.

Parameters
hThe h value [0-180]
sThe s value [0-255]
vThe v value [0-255]
Returns
The color

Member Data Documentation

◆ kAntiqueWhite

constexpr Color frc::Color::kAntiqueWhite
inlinestaticconstexpr
Initial value:
{0.98039216f, 0.92156863f,
0.84313726f}

#FAEBD7.

◆ kCornflowerBlue

constexpr Color frc::Color::kCornflowerBlue
inlinestaticconstexpr
Initial value:
{0.39215687f, 0.58431375f,
0.92941177f}

#6495ED.

◆ kDarkGoldenrod

constexpr Color frc::Color::kDarkGoldenrod
inlinestaticconstexpr
Initial value:
{0.72156864f, 0.5254902f,
0.043137256f}

#B8860B.

◆ kDarkOliveGreen

constexpr Color frc::Color::kDarkOliveGreen
inlinestaticconstexpr
Initial value:
{0.33333334f, 0.41960785f,
0.18431373f}

#556B2F.

◆ kDarkSeaGreen

constexpr Color frc::Color::kDarkSeaGreen
inlinestaticconstexpr
Initial value:
{0.56078434f, 0.7372549f,
0.56078434f}

#8FBC8F.

◆ kDarkSlateBlue

constexpr Color frc::Color::kDarkSlateBlue
inlinestaticconstexpr
Initial value:
{0.28235295f, 0.23921569f,
0.54509807f}

#483D8B.

◆ kDarkSlateGray

constexpr Color frc::Color::kDarkSlateGray
inlinestaticconstexpr
Initial value:
{0.18431373f, 0.30980393f,
0.30980393f}

#2F4F4F.

◆ kFirstRed

constexpr Color frc::Color::kFirstRed
inlinestaticconstexpr
Initial value:
{0.9294117648, 0.1098039216,
0.1411764706}

#ED1C24.

◆ kForestGreen

constexpr Color frc::Color::kForestGreen
inlinestaticconstexpr
Initial value:
{0.13333334f, 0.54509807f,
0.13333334f}

#228B22.

◆ kLightGoldenrodYellow

constexpr Color frc::Color::kLightGoldenrodYellow
inlinestaticconstexpr
Initial value:
{0.98039216f, 0.98039216f,
0.8235294f}

#FAFAD2.

◆ kLightSeaGreen

constexpr Color frc::Color::kLightSeaGreen
inlinestaticconstexpr
Initial value:
{0.1254902f, 0.69803923f,
0.6666667f}

#20B2AA.

◆ kLightSkyBlue

constexpr Color frc::Color::kLightSkyBlue
inlinestaticconstexpr
Initial value:
{0.5294118f, 0.80784315f,
0.98039216f}

#87CEFA.

◆ kLightSteelBlue

constexpr Color frc::Color::kLightSteelBlue
inlinestaticconstexpr
Initial value:
{0.6901961f, 0.76862746f,
0.87058824f}

#B0C4DE.

◆ kMediumPurple

constexpr Color frc::Color::kMediumPurple
inlinestaticconstexpr
Initial value:
{0.5764706f, 0.4392157f,
0.85882354f}

#9370DB.

◆ kMediumSeaGreen

constexpr Color frc::Color::kMediumSeaGreen
inlinestaticconstexpr
Initial value:
{0.23529412f, 0.7019608f,
0.44313726f}

#3CB371.

◆ kMediumSlateBlue

constexpr Color frc::Color::kMediumSlateBlue
inlinestaticconstexpr
Initial value:
{0.48235294f, 0.40784314f,
0.93333334f}

#7B68EE.

◆ kMediumVioletRed

constexpr Color frc::Color::kMediumVioletRed
inlinestaticconstexpr
Initial value:
{0.78039217f, 0.08235294f,
0.52156866f}

#C71585.

◆ kMidnightBlue

constexpr Color frc::Color::kMidnightBlue
inlinestaticconstexpr
Initial value:
{0.09803922f, 0.09803922f,
0.4392157f}

#191970.

◆ kPaleGoldenrod

constexpr Color frc::Color::kPaleGoldenrod
inlinestaticconstexpr
Initial value:
{0.93333334f, 0.9098039f,
0.6666667f}

#EEE8AA.

◆ kPaleTurquoise

constexpr Color frc::Color::kPaleTurquoise
inlinestaticconstexpr
Initial value:
{0.6862745f, 0.93333334f,
0.93333334f}

#AFEEEE.

◆ kPaleVioletRed

constexpr Color frc::Color::kPaleVioletRed
inlinestaticconstexpr
Initial value:
{0.85882354f, 0.4392157f,
0.5764706f}

#DB7093.

◆ kSaddleBrown

constexpr Color frc::Color::kSaddleBrown
inlinestaticconstexpr
Initial value:
{0.54509807f, 0.27058825f,
0.07450981f}

#8B4513.


The documentation for this class was generated from the following file: