mirror of
https://github.com/lune-org/lune.git
synced 2025-05-04 10:43:57 +01:00
Use rbx-dom's Color3uint8 <-> Color3 conversions
From<Color3> for DomCoolor3uint8 was not correct here, and these conversions are already implemented by rbx-dom anyway
This commit is contained in:
parent
603cc10b42
commit
e864f404d1
1 changed files with 2 additions and 10 deletions
|
@ -287,20 +287,12 @@ impl From<Color3> for DomColor3 {
|
|||
|
||||
impl From<DomColor3uint8> for Color3 {
|
||||
fn from(v: DomColor3uint8) -> Self {
|
||||
Self {
|
||||
r: (v.r as f32) / 255f32,
|
||||
g: (v.g as f32) / 255f32,
|
||||
b: (v.b as f32) / 255f32,
|
||||
}
|
||||
Color3::from(DomColor3::from(v))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Color3> for DomColor3uint8 {
|
||||
fn from(v: Color3) -> Self {
|
||||
Self {
|
||||
r: v.r.clamp(u8::MIN as f32, u8::MAX as f32) as u8,
|
||||
g: v.g.clamp(u8::MIN as f32, u8::MAX as f32) as u8,
|
||||
b: v.b.clamp(u8::MIN as f32, u8::MAX as f32) as u8,
|
||||
}
|
||||
DomColor3uint8::from(DomColor3::from(v))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue