259 RageVector4(
float x1,
float y1,
float z1,
float w1)
268 operator float*() {
return &x; };
269 operator const float*()
const {
return &x; };
308 return RageVector4(x + other.x, y + other.y, z + other.z, w + other.w);
312 return RageVector4(x - other.x, y - other.y, z - other.z, w - other.w);
328 float x{ 0 }, y{ 0 }, z{ 0 }, w{ 0 };
342 RageColor(
float r1,
float g1,
float b1,
float a1)
356 operator float*() {
return &r; };
357 operator const float*()
const {
return &r; };
400 return RageColor(r + other.r, g + other.g, b + other.b, a + other.a);
404 return RageColor(r - other.r, g - other.g, b - other.b, a - other.a);
408 return RageColor(r * other.r, g * other.g, b * other.b, a * other.a);
410 auto operator*(
float f)
const ->
RageColor
412 return RageColor(r * f, g * f, b * f, a * f);
415 auto operator/(
float f)
const ->
RageColor
417 return RageColor(r / f, g / f, b / f, a / f);
425 auto operator==(
const RageColor& other)
const ->
bool
427 return r == other.r && g == other.g && b == other.b && a == other.a;
429 auto operator!=(
const RageColor& other)
const ->
bool
431 return !operator==(other);
434 auto FromString(
const std::string& str) ->
bool
436 int result = sscanf(str.c_str(),
"%f,%f,%f,%f", &r, &g, &b, &a);
449 result = sscanf(str.c_str(),
"#%2x%2x%2x%2x", &ir, &ig, &ib, &ia);
469 [[nodiscard]]
auto ToString()
const -> std::string;
470 static auto NormalizeColorString(
const std::string& sColor) -> std::string;
472 void PushTable(lua_State* L)
const;
473 void FromStack(lua_State* L,
int iPos);
474 void FromStackCompat(lua_State* L,
int iPos);
476 float r{ 0 }, g{ 0 }, b{ 0 }, a{ 0 };