A simple 2D plot library

This commit is contained in:
Emil Ernerfeldt
2021-02-17 22:54:10 +01:00
parent 7dad76b913
commit a19140ec67
14 changed files with 1039 additions and 11 deletions
+6
View File
@@ -124,6 +124,12 @@ impl Color32 {
Rgba::from(self).to_opaque().into()
}
/// Returns an additive version of self
pub fn additive(self) -> Self {
let [r, g, b, _] = self.to_array();
Self([r, g, b, 0])
}
/// Premultiplied RGBA
pub fn to_array(&self) -> [u8; 4] {
[self.r(), self.g(), self.b(), self.a()]