mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Implement bytemuck for epaint::Rgba
Closes https://github.com/emilk/egui/pull/784
This commit is contained in:
@@ -185,8 +185,10 @@ impl Color32 {
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
/// 0-1 linear space `RGBA` color with premultiplied alpha.
|
/// 0-1 linear space `RGBA` color with premultiplied alpha.
|
||||||
|
#[repr(C)]
|
||||||
#[derive(Clone, Copy, Debug, Default, PartialEq)]
|
#[derive(Clone, Copy, Debug, Default, PartialEq)]
|
||||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||||
|
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
|
||||||
pub struct Rgba(pub(crate) [f32; 4]);
|
pub struct Rgba(pub(crate) [f32; 4]);
|
||||||
|
|
||||||
impl std::ops::Index<usize> for Rgba {
|
impl std::ops::Index<usize> for Rgba {
|
||||||
|
|||||||
Reference in New Issue
Block a user