 |
Blamite Game Engine - Blam (Core)
|
Go to the documentation of this file.
57 return std::string(std::to_string(
r) +
"," + std::to_string(
g) +
"," + std::to_string(
b) +
"," + std::to_string(
a));
78 std::string new_string = format;
85 double r_float = (double)
r / 255.0f;
86 double g_float = (double)
g / 255.0f;
87 double b_float = (double)
b / 255.0f;
88 double a_float = (double)
a / 255.0f;
105 return ToString(
"rgba({r},{g},{b},{a>f})");
121 if (color_values.size() == 3)
123 r = atoi(color_values.at(0).c_str());
124 g = atoi(color_values.at(1).c_str());
125 b = atoi(color_values.at(2).c_str());
130 else if (color_values.size() == 4)
132 r = atoi(color_values.at(0).c_str());
133 g = atoi(color_values.at(1).c_str());
134 b = atoi(color_values.at(2).c_str());
135 a = atoi(color_values.at(3).c_str());
BLAM std::string Replace(std::string orig, std::string to_replace, std::string replace_with)
Replaces part of a string with another string.
Definition: string.cpp:67
BlamColor()
Definition: colors.h:26
BLAM std::vector< std::string > Split(std::string string, std::string splitter)
Splits a string around any instance of a substring.
Definition: string.cpp:87
BLAM BlamColor TranslateTextColorCode(char character)
Converts a character to its equivalent color code for use in multi-colored text.
Definition: colors.cpp:3
short g
The Green value of the color.
Definition: colors.h:22
Namespace for things relating to global engine color data.
Definition: colors.h:149
BLAM D2D1_COLOR_F D2DColorFromBlamColor(BlamColor color)
Converts a BlamColor object into its equivalent D2D1_COLOR_F object.
Definition: colors.cpp:44
short a
The Alpha value of the color.
Definition: colors.h:24
short r
The Red value of the color.
Definition: colors.h:21
BlamColor(short _r, short _g, short _b)
Definition: colors.h:34
short b
The Blue value of the color.
Definition: colors.h:23
std::string ToString()
Converts the color value to a string.
Definition: colors.h:55
std::string ToStringForCSS()
Converts the color to a string that can be used with CSS.
Definition: colors.h:103
bool FromString(std::string string)
Attempts to set color information from a string.
Definition: colors.h:117
std::string ToString(std::string format)
Converts the color value to a string in the specified format.
Definition: colors.h:76
BlamColor(short _r, short _g, short _b, short _a)
Definition: colors.h:42
#define BLAM
Definition: colors.h:10
Structure representing a color.
Definition: colors.h:18