#[derive(Clone)]
pub struct ColorSequence(rbx_types::ColorSequence);
impl ColorSequence{
	pub const fn new(keypoints:Vec<rbx_types::ColorSequenceKeypoint>)->Self{
		Self(rbx_types::ColorSequence{keypoints})
	}
}
impl From<ColorSequence> for rbx_types::ColorSequence{
	fn from(ColorSequence(value):ColorSequence)->rbx_types::ColorSequence{
		value
	}
}

pub fn set_globals(lua:&mlua::Lua,globals:&mlua::Table)->Result<(),mlua::Error>{
	let table=lua.create_table()?;

	table.raw_set("new",
		lua.create_function(|_,_:mlua::MultiValue|
			Ok(ColorSequence::new(Vec::new()))
		)?
	)?;

	globals.set("ColorSequence",table)?;

	Ok(())
}

impl mlua::UserData for ColorSequence{}
type_from_lua_userdata_clone!(ColorSequence);
