1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-01-04 08:43:06 +00:00

Implement equal_to for Color

This commit is contained in:
Evil Eye 2025-06-12 17:48:11 +02:00
parent be0cbb7277
commit 45a51bceb2
2 changed files with 2 additions and 1 deletions

View file

@ -237,6 +237,7 @@ namespace LuaUtil
colorType["asRgba"] = [](const Misc::Color& c) { return Vec4(c.r(), c.g(), c.b(), c.a()); };
colorType["asRgb"] = [](const Misc::Color& c) { return Vec3(c.r(), c.g(), c.b()); };
colorType["asHex"] = [](const Misc::Color& c) { return c.toHex(); };
colorType[sol::meta_function::equal_to] = [](const Misc::Color& a, const Misc::Color& b) { return a == b; };
sol::table color(lua, sol::create);
color["rgba"] = [](float r, float g, float b, float a) { return Misc::Color(r, g, b, a); };

View file

@ -157,7 +157,7 @@ testing.registerGlobalTest('record creation', function()
value = 10,
duration = 12,
radius = 30,
color = 5,
color = util.color.hex('123456'),
name = "TestLight",
model = "meshes/marker_door.dae"
}