Repository: j0ru/kickoff (language: rust)

Issue:
CSS colors are not correctly converted
CSS colors are not premultiplied, they must be converted by multiplying each channel by the alpha value:
```diff
diff --git a/src/color.rs b/src/color.rs
index a92bcae..37fc824 100644
--- a/src/color.rs
+++ b/src/color.rs
@@ -10,9 +10,9 @@ pub struct Color(pub u8, pub u8, pub u8, pub u8);
 impl From<css_color::Rgba> for Color {
     fn from(c: css_color::Rgba) -> Self {
         Color(
-            (c.red * 255.) as u8,
-            (c.green * 255.) as u8,
-            (c.blue * 255.) as u8,
+            (c.red * c.alpha * 255.) as u8,
+            (c.green * c.alpha * 255.) as u8,
+            (c.blue * c.alpha * 255.) as u8,
             (c.alpha * 255.) as u8,
         )
     }
```


Discussion / hints:
Huh, I hadn't heard of premultiplied colors before, but that works way better.

Thanks!

Fix patch:
diff --git a/src/color.rs b/src/color.rs
index a92bcae..84697ca 100644
--- a/src/color.rs
+++ b/src/color.rs
@@ -10,9 +10,9 @@ pub struct Color(pub u8, pub u8, pub u8, pub u8);
 impl From<css_color::Rgba> for Color {
     fn from(c: css_color::Rgba) -> Self {
         Color(
-            (c.red * 255.) as u8,
-            (c.green * 255.) as u8,
-            (c.blue * 255.) as u8,
+            (c.red * 255. * c.alpha) as u8,
+            (c.green * 255. * c.alpha) as u8,
+            (c.blue * 255. * c.alpha) as u8,
             (c.alpha * 255.) as u8,
         )
     }


Test patch: