Elaztek Developer Hub
Blamite Game Engine - Strings  00381.04.17.23.2324.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>
5 
6 #ifdef STRINGS_EXPORTS
7 #define STRINGS_API __declspec(dllexport)
8 #else
9 #define STRINGS_API __declspec(dllimport)
10 #endif
11 
12 typedef unsigned char byte;
13 
20 {
21 private:
22  byte convert_float_clamped(float f);
23 
24 public:
25  byte r = 255;
26  byte g = 255;
27  byte b = 255;
28  byte a = 255;
29 
30  BlamColor();
31 
39  BlamColor(byte _r, byte _g, byte _b);
40 
49  BlamColor(byte _r, byte _g, byte _b, byte _a);
50 
56  std::string ToString();
57 
63  float GetRedAsFloat();
64 
70  float GetGreenAsFloat();
71 
77  float GetBlueAsFloat();
78 
84  float GetAlphaAsFloat();
85 
94  int GetColorAsInt();
95 
112  std::string ToString(std::string format);
113 
119  std::string ToStringForCSS();
120 
130  bool FromString(std::string string);
131 
141  BlamVector4 ToVector4();
142 
151  void FromVector4(BlamVector4 vector);
152 
163  bool Equals(BlamColor other_color);
164 
174  BlamVector3 ToVector3();
175 
184  void FromVector3(BlamVector3 vector);
185 };
BlamVector3
Structure representing a 3D vector.
Definition: vector.h:80
byte
unsigned char byte
Definition: BlamColor.h:12
BlamVector4
Structure representing a 4D vector.
Definition: vector.h:162
STRINGS_API
#define STRINGS_API
Definition: BlamColor.h:9
vector.h
BlamColor
Class representing a color.
Definition: BlamColor.h:19