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:
@@ -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()]
|
||||
|
||||
Reference in New Issue
Block a user