Arcade Shooter
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
KatanaEngine::Color Class Reference

Represents a four-component color using red, green, blue, and alpha data. More...

#include <Color.h>

Public Member Functions

 Color (const float red=1, const float green=1, const float blue=1, const float alpha=1)
 Instantiate a color object. More...
 
const Color operator* (const float scalar) const
 Multiplies each component by a scale factor. More...
 
bool operator== (const Color &color) const
 Determines if two colors are equal. More...
 
bool operator!= (const Color &color) const
 Determines if two colors are not equal. More...
 
ALLEGRO_COLOR GetAllegroColor () const
 Get the color-equivalent allegro color. More...
 

Static Public Member Functions

static Color Lerp (const Color &start, const Color &end, const float value)
 Linearly interpolate between two colors. More...
 

Static Public Attributes

static const Color AliceBlue = Color(0.94f, 0.97f, 1.0f)
 AliceBlue.
 
static const Color AntiqueWhite = Color(0.98f, 0.92f, 0.84f)
 AntiqueWhite.
 
static const Color Aqua = Color(0.0f, 1.0f, 1.0f)
 Aqua.
 
static const Color Aquamarine = Color(0.5f, 1.0f, 0.83f)
 Aquamarine.
 
static const Color Azure = Color(0.94f, 1.0f, 1.0f)
 Azure.
 
static const Color Beige = Color(0.96f, 0.96f, 0.86f)
 Beige.
 
static const Color Bisque = Color(1.0f, 0.89f, 0.77f)
 Bisque.
 
static const Color Black = Color(0.0f, 0.0f, 0.0f)
 Black.
 
static const Color BlanchedAlmond = Color(1.0f, 0.92f, 0.8f)
 BlanchedAlmond.
 
static const Color Blue = Color(0.0f, 0.0f, 1.0f)
 Blue.
 
static const Color BlueViolet = Color(0.54f, 0.17f, 0.89f)
 BlueViolet.
 
static const Color Brown = Color(0.65f, 0.16f, 0.16f)
 Brown.
 
static const Color Burlywood = Color(0.87f, 0.72f, 0.53f)
 Burlywood.
 
static const Color CadetBlue = Color(0.37f, 0.62f, 0.63f)
 CadetBlue.
 
static const Color Chartreuse = Color(0.5f, 1.0f, 0.0f)
 Chartreuse.
 
static const Color Chocolate = Color(0.82f, 0.41f, 0.12f)
 Chocolate.
 
static const Color Coral = Color(1.0f, 0.5f, 0.31f)
 Coral.
 
static const Color Cornflower = Color(0.39f, 0.58f, 0.93f)
 Cornflower.
 
static const Color Cornsilk = Color(1.0f, 0.97f, 0.86f)
 Cornsilk.
 
static const Color Crimson = Color(0.86f, 0.08f, 0.24f)
 Crimson.
 
static const Color Cyan = Color(0.0f, 1.0f, 1.0f)
 Cyan.
 
static const Color DarkBlue = Color(0.0f, 0.0f, 0.55f)
 DarkBlue.
 
static const Color DarkCyan = Color(0.0f, 0.55f, 0.55f)
 DarkCyan.
 
static const Color DarkGoldenrod = Color(0.72f, 0.53f, 0.04f)
 DarkGoldenrod.
 
static const Color DarkGray = Color(0.66f, 0.66f, 0.66f)
 DarkGray.
 
static const Color DarkGreen = Color(0.0f, 0.39f, 0.0f)
 DarkGreen.
 
static const Color DarkKhaki = Color(0.74f, 0.72f, 0.42f)
 DarkKhaki.
 
static const Color DarkMagenta = Color(0.55f, 0.0f, 0.55f)
 DarkMagenta.
 
static const Color DarkOliveGreen = Color(0.33f, 0.42f, 0.18f)
 DarkOliveGreen.
 
static const Color DarkOrange = Color(1.0f, 0.55f, 0.0f)
 DarkOrange.
 
static const Color DarkOrchid = Color(0.6f, 0.2f, 0.8f)
 DarkOrchid.
 
static const Color DarkRed = Color(0.55f, 0.0f, 0.0f)
 DarkRed.
 
static const Color DarkSalmon = Color(0.91f, 0.59f, 0.48f)
 DarkSalmon.
 
static const Color DarkSeaGreen = Color(0.56f, 0.74f, 0.56f)
 DarkSeaGreen.
 
static const Color DarkSlateBlue = Color(0.28f, 0.24f, 0.55f)
 DarkSlateBlue.
 
static const Color DarkSlateGray = Color(0.18f, 0.31f, 0.31f)
 DarkSlateGray.
 
static const Color DarkTurquoise = Color(0.0f, 0.81f, 0.82f)
 DarkTurquoise.
 
static const Color DarkViolet = Color(0.58f, 0.0f, 0.83f)
 DarkViolet.
 
static const Color DeepPink = Color(1.0f, 0.08f, 0.58f)
 DeepPink.
 
static const Color DeepSkyBlue = Color(0.0f, 0.75f, 1.0f)
 DeepSkyBlue.
 
static const Color DimGray = Color(0.41f, 0.41f, 0.41f)
 DimGray.
 
static const Color DodgerBlue = Color(0.12f, 0.56f, 1.0f)
 DodgerBlue.
 
static const Color Firebrick = Color(0.7f, 0.13f, 0.13f)
 Firebrick.
 
static const Color FloralWhite = Color(1.0f, 0.98f, 0.94f)
 FloralWhite.
 
static const Color ForestGreen = Color(0.13f, 0.55f, 0.13f)
 ForestGreen.
 
static const Color Fuchsia = Color(1.0f, 0.0f, 1.0f)
 Fuchsia.
 
static const Color Gainsboro = Color(0.86f, 0.86f, 0.86f)
 Gainsboro.
 
static const Color GhostWhite = Color(0.97f, 0.97f, 1.0f)
 GhostWhite.
 
static const Color Gold = Color(1.0f, 0.84f, 0.0f)
 Gold.
 
static const Color Goldenrod = Color(0.85f, 0.65f, 0.13f)
 Goldenrod.
 
static const Color Gray = Color(0.75f, 0.75f, 0.75f)
 Gray.
 
static const Color WebGray = Color(0.5f, 0.5f, 0.5f)
 WebGray.
 
static const Color Green = Color(0.0f, 1.0f, 0.0f)
 Green.
 
static const Color WebGreen = Color(0.0f, 0.5f, 0.0f)
 WebGreen.
 
static const Color GreenYellow = Color(0.68f, 1.0f, 0.18f)
 GreenYellow.
 
static const Color Honeydew = Color(0.94f, 1.0f, 0.94f)
 Honeydew.
 
static const Color HotPink = Color(1.0f, 0.41f, 0.71f)
 HotPink.
 
static const Color IndianRed = Color(0.8f, 0.36f, 0.36f)
 IndianRed.
 
static const Color Indigo = Color(0.29f, 0.0f, 0.51f)
 Indigo.
 
static const Color Ivory = Color(1.0f, 1.0f, 0.94f)
 Ivory.
 
static const Color Khaki = Color(0.94f, 0.9f, 0.55f)
 Khaki.
 
static const Color Lavender = Color(0.9f, 0.9f, 0.98f)
 Lavender.
 
static const Color LavenderBlush = Color(1.0f, 0.94f, 0.96f)
 LavenderBlush.
 
static const Color LawnGreen = Color(0.49f, 0.99f, 0.0f)
 LawnGreen.
 
static const Color LemonChiffon = Color(1.0f, 0.98f, 0.8f)
 LemonChiffon.
 
static const Color LightBlue = Color(0.68f, 0.85f, 0.9f)
 LightBlue.
 
static const Color LightCoral = Color(0.94f, 0.5f, 0.5f)
 LightCoral.
 
static const Color LightCyan = Color(0.88f, 1.0f, 1.0f)
 LightCyan.
 
static const Color LightGoldenrod = Color(0.98f, 0.98f, 0.82f)
 LightGoldenrod.
 
static const Color LightGray = Color(0.83f, 0.83f, 0.83f)
 LightGray.
 
static const Color LightGreen = Color(0.56f, 0.93f, 0.56f)
 LightGreen.
 
static const Color LightPink = Color(1.0f, 0.71f, 0.76f)
 LightPink.
 
static const Color LightSalmon = Color(1.0f, 0.63f, 0.48f)
 LightSalmon.
 
static const Color LightSeaGreen = Color(0.13f, 0.7f, 0.67f)
 LightSeaGreen.
 
static const Color LightSkyBlue = Color(0.53f, 0.81f, 0.98f)
 LightSkyBlue.
 
static const Color LightSlateGray = Color(0.47f, 0.53f, 0.6f)
 LightSlateGray.
 
static const Color LightSteelBlue = Color(0.69f, 0.77f, 0.87f)
 LightSteelBlue.
 
static const Color LightYellow = Color(1.0f, 1.0f, 0.88f)
 LightYellow.
 
static const Color Lime = Color(0.0f, 1.0f, 0.0f)
 Lime.
 
static const Color LimeGreen = Color(0.2f, 0.8f, 0.2f)
 LimeGreen.
 
static const Color Linen = Color(0.98f, 0.94f, 0.9f)
 Linen.
 
static const Color Magenta = Color(1.0f, 0.0f, 1.0f)
 Magenta.
 
static const Color Maroon = Color(0.69f, 0.19f, 0.38f)
 Maroon.
 
static const Color WebMaroon = Color(0.5f, 0.0f, 0.0f)
 WebMaroon.
 
static const Color MediumAquamarine = Color(0.4f, 0.8f, 0.67f)
 MediumAquamarine.
 
static const Color MediumBlue = Color(0.0f, 0.0f, 0.8f)
 MediumBlue.
 
static const Color MediumOrchid = Color(0.73f, 0.33f, 0.83f)
 MediumOrchid.
 
static const Color MediumPurple = Color(0.58f, 0.44f, 0.86f)
 MediumPurple.
 
static const Color MediumSeaGreen = Color(0.24f, 0.7f, 0.44f)
 MediumSeaGreen.
 
static const Color MediumSlateBlue = Color(0.48f, 0.41f, 0.93f)
 MediumSlateBlue.
 
static const Color MediumSpringGreen = Color(0.0f, 0.98f, 0.6f)
 MediumSpringGreen.
 
static const Color MediumTurquoise = Color(0.28f, 0.82f, 0.8f)
 MediumTurquoise.
 
static const Color MediumVioletRed = Color(0.78f, 0.08f, 0.52f)
 MediumVioletRed.
 
static const Color MidnightBlue = Color(0.1f, 0.1f, 0.44f)
 MidnightBlue.
 
static const Color MintCream = Color(0.96f, 1.0f, 0.98f)
 MintCream.
 
static const Color MistyRose = Color(1.0f, 0.89f, 0.88f)
 MistyRose.
 
static const Color Moccasin = Color(1.0f, 0.89f, 0.71f)
 Moccasin.
 
static const Color NavajoWhite = Color(1.0f, 0.87f, 0.68f)
 NavajoWhite.
 
static const Color NavyBlue = Color(0.0f, 0.0f, 0.5f)
 NavyBlue.
 
static const Color OldLace = Color(0.99f, 0.96f, 0.9f)
 OldLace.
 
static const Color Olive = Color(0.5f, 0.5f, 0.0f)
 Olive.
 
static const Color OliveDrab = Color(0.42f, 0.56f, 0.14f)
 OliveDrab.
 
static const Color Orange = Color(1.0f, 0.65f, 0.0f)
 Orange.
 
static const Color OrangeRed = Color(1.0f, 0.27f, 0.0f)
 OrangeRed.
 
static const Color Orchid = Color(0.85f, 0.44f, 0.84f)
 Orchid.
 
static const Color PaleGoldenrod = Color(0.93f, 0.91f, 0.67f)
 PaleGoldenrod.
 
static const Color PaleGreen = Color(0.6f, 0.98f, 0.6f)
 PaleGreen.
 
static const Color PaleTurquoise = Color(0.69f, 0.93f, 0.93f)
 PaleTurquoise.
 
static const Color PaleVioletRed = Color(0.86f, 0.44f, 0.58f)
 PaleVioletRed.
 
static const Color PapayaWhip = Color(1.0f, 0.94f, 0.84f)
 PapayaWhip.
 
static const Color PeachPuff = Color(1.0f, 0.85f, 0.73f)
 PeachPuff.
 
static const Color Peru = Color(0.8f, 0.52f, 0.25f)
 Peru.
 
static const Color Pink = Color(1.0f, 0.75f, 0.8f)
 Pink.
 
static const Color Plum = Color(0.87f, 0.63f, 0.87f)
 Plum.
 
static const Color PowderBlue = Color(0.69f, 0.88f, 0.9f)
 PowderBlue.
 
static const Color Purple = Color(0.63f, 0.13f, 0.94f)
 Purple.
 
static const Color WebPurple = Color(0.5f, 0.0f, 0.5f)
 WebPurple.
 
static const Color RebeccaPurple = Color(0.4f, 0.2f, 0.6f)
 RebeccaPurple.
 
static const Color Red = Color(1.0f, 0.0f, 0.0f)
 Red.
 
static const Color RosyBrown = Color(0.74f, 0.56f, 0.56f)
 RosyBrown.
 
static const Color RoyalBlue = Color(0.25f, 0.41f, 0.88f)
 RoyalBlue.
 
static const Color SaddleBrown = Color(0.55f, 0.27f, 0.07f)
 SaddleBrown.
 
static const Color Salmon = Color(0.98f, 0.5f, 0.45f)
 Salmon.
 
static const Color SandyBrown = Color(0.96f, 0.64f, 0.38f)
 SandyBrown.
 
static const Color SeaGreen = Color(0.18f, 0.55f, 0.34f)
 SeaGreen.
 
static const Color Seashell = Color(1.0f, 0.96f, 0.93f)
 Seashell.
 
static const Color Sienna = Color(0.63f, 0.32f, 0.18f)
 Sienna.
 
static const Color Silver = Color(0.75f, 0.75f, 0.75f)
 Silver.
 
static const Color SkyBlue = Color(0.53f, 0.81f, 0.92f)
 SkyBlue.
 
static const Color SlateBlue = Color(0.42f, 0.35f, 0.8f)
 SlateBlue.
 
static const Color SlateGray = Color(0.44f, 0.5f, 0.56f)
 SlateGray.
 
static const Color Snow = Color(1.0f, 0.98f, 0.98f)
 Snow.
 
static const Color SpringGreen = Color(0.0f, 1.0f, 0.5f)
 SpringGreen.
 
static const Color SteelBlue = Color(0.27f, 0.51f, 0.71f)
 SteelBlue.
 
static const Color Tan = Color(0.82f, 0.71f, 0.55f)
 Tan.
 
static const Color Teal = Color(0.0f, 0.5f, 0.5f)
 Teal.
 
static const Color Thistle = Color(0.85f, 0.75f, 0.85f)
 Thistle.
 
static const Color Tomato = Color(1.0f, 0.39f, 0.28f)
 Tomato.
 
static const Color Turquoise = Color(0.25f, 0.88f, 0.82f)
 Turquoise.
 
static const Color Violet = Color(0.93f, 0.51f, 0.93f)
 Violet.
 
static const Color Wheat = Color(0.96f, 0.87f, 0.7f)
 Wheat.
 
static const Color White = Color(1.0f, 1.0f, 1.0f)
 White.
 
static const Color WhiteSmoke = Color(0.96f, 0.96f, 0.96f)
 WhiteSmoke.
 
static const Color Yellow = Color(1.0f, 1.0f, 0.0f)
 Yellow.
 
static const Color YellowGreen = Color(0.6f, 0.8f, 0.2f)
 YellowGreen.
 

Detailed Description

Represents a four-component color using red, green, blue, and alpha data.

Constructor & Destructor Documentation

◆ Color()

KatanaEngine::Color::Color ( const float  red = 1,
const float  green = 1,
const float  blue = 1,
const float  alpha = 1 
)

Instantiate a color object.

Parameters
redThe red value of the color.
greenThe green value of the color.
blueThe blue value of the color.
alphaThe alpha value (opacity) of the color.

Member Function Documentation

◆ GetAllegroColor()

ALLEGRO_COLOR KatanaEngine::Color::GetAllegroColor ( ) const
inline

Get the color-equivalent allegro color.

Returns
Returns the mapped allegro color.

◆ Lerp()

Color KatanaEngine::Color::Lerp ( const Color start,
const Color end,
const float  value 
)
static

Linearly interpolate between two colors.

Parameters
startThe result when the value is zero.
endThe result when the value is one.
valueA value between 0 and 1 that will indicate the resulting weight between start and end.
Returns
Returns the interpolated color value between start and end.

◆ operator!=()

bool KatanaEngine::Color::operator!= ( const Color color) const

Determines if two colors are not equal.

Parameters
colorThe color to compare.
Returns
Returns true if the colors are not equal, false otherwise.

◆ operator*()

const Color KatanaEngine::Color::operator* ( const float  scalar) const

Multiplies each component by a scale factor.

Parameters
scalarThe scale factor.
Returns
Returns the scaled color.

◆ operator==()

bool KatanaEngine::Color::operator== ( const Color color) const

Determines if two colors are equal.

Parameters
colorThe color to compare.
Returns
Returns true if the colors are equal, false otherwise.

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