Elaztek Developer Hub
Blamite Game Engine - Strings  00326.06.27.21.0407.blamite
A library containing general purpose utilities and classes for use in multiple projects.
BlamColor.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #ifdef STRINGS_EXPORTS
6 #define STRINGS_API __declspec(dllexport)
7 #else
8 #define STRINGS_API __declspec(dllimport)
9 #endif
10 
11 typedef unsigned char byte;
12 
19 {
20 public:
21  byte r = 255;
22  byte g = 255;
23  byte b = 255;
24  byte a = 255;
25 
26  BlamColor();
27 
35  BlamColor(byte _r, byte _g, byte _b);
36 
45  BlamColor(byte _r, byte _g, byte _b, byte _a);
46 
52  std::string ToString();
53 
59  float GetRedAsFloat();
60 
66  float GetGreenAsFloat();
67 
73  float GetBlueAsFloat();
74 
80  float GetAlphaAsFloat();
81 
90  int GetColorAsInt();
91 
108  std::string ToString(std::string format);
109 
115  std::string ToStringForCSS();
116 
126  bool FromString(std::string string);
127 };
byte
unsigned char byte
Definition: BlamColor.h:11
STRINGS_API
#define STRINGS_API
Definition: BlamColor.h:8
BlamColor
Class representing a color.
Definition: BlamColor.h:18