roblox_emulator: Color3.FromRGB alias

This commit is contained in:
2025-04-23 15:22:16 -07:00
parent 2ac38efef6
commit 7fffe05751

View File

@@ -33,11 +33,12 @@ pub fn set_globals(lua:&mlua::Lua,globals:&mlua::Table)->Result<(),mlua::Error>{
Ok(Color3::new(r.into(),g.into(),b.into()))
)?
)?;
table.raw_set("fromRGB",
lua.create_function(|_,(r,g,b):(u8,u8,u8)|
Ok(Color3::from_rgb(r,g,b))
)?
let from_rgb=lua.create_function(|_,(r,g,b):(u8,u8,u8)|
Ok(Color3::from_rgb(r,g,b))
)?;
table.raw_set("fromRGB",from_rgb.clone())?;
table.raw_set("FromRGB",from_rgb)?;
globals.set("Color3",table)?;