Working on parser
This commit is contained in:
@ -18,6 +18,33 @@ namespace Dawn {
|
||||
(float_t)a / 100.0f
|
||||
};
|
||||
}
|
||||
|
||||
struct Color operator * (const float_t &x) {
|
||||
return {
|
||||
(uint8_t)(r * x),
|
||||
(uint8_t)(g * x),
|
||||
(uint8_t)(b * x),
|
||||
(uint8_t)(a * x)
|
||||
};
|
||||
}
|
||||
|
||||
struct Color operator - (const struct Color &color) {
|
||||
return {
|
||||
(uint8_t)(r - color.r),
|
||||
(uint8_t)(g - color.g),
|
||||
(uint8_t)(b - color.b),
|
||||
(uint8_t)(a - color.a)
|
||||
};
|
||||
}
|
||||
|
||||
struct Color operator + (const struct Color &color) {
|
||||
return {
|
||||
(uint8_t)(r + color.r),
|
||||
(uint8_t)(g + color.g),
|
||||
(uint8_t)(b + color.b),
|
||||
(uint8_t)(a + color.a)
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
#define COLOR_WHITE { 255, 255, 255, 100 }
|
||||
|
Reference in New Issue
Block a user