Add Block widget

This commit is contained in:
Joscha 2024-03-09 00:52:14 +01:00
parent e31eea8178
commit 2c8f9685b9
7 changed files with 131 additions and 6 deletions

View file

@ -1,5 +1,9 @@
use palette::Srgba;
pub const TRANSPARENT: Srgba = Srgba::new(0.0, 0.0, 0.0, 0.0);
pub const BLACK: Srgba = Srgba::new(0.0, 0.0, 0.0, 1.0);
pub const WHITE: Srgba = Srgba::new(1.0, 1.0, 1.0, 1.0);
pub fn from_image_color(color: image::Rgba<u8>) -> Srgba {
let [r, g, b, a] = color.0;
Srgba::new(r, g, b, a).into_format()