1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 12:50:04 -04:00

A simple 2D plot library

This commit is contained in:
Emil Ernerfeldt
2021-02-14 21:39:04 +01:00
parent 7dad76b913
commit a19140ec67
14 changed files with 1039 additions and 11 deletions

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()]