Skip to content

Commit

Permalink
Add hex methods for RGB, packed format for u32 RGB
Browse files Browse the repository at this point in the history
Add into_hex and from_hex methods for RGB and RGBA
Implement packed RGBA structs with representations
    - RGBA
    - ARGB
    - BGRA
    - ABGR
  • Loading branch information
okaneco committed Feb 22, 2020
1 parent cbffb27 commit 813ea12
Show file tree
Hide file tree
Showing 4 changed files with 521 additions and 5 deletions.
5 changes: 4 additions & 1 deletion palette/src/lib.rs
Expand Up @@ -176,7 +176,10 @@ pub use hwb::{Hwb, Hwba};
pub use lab::{Lab, Laba};
pub use lch::{Lch, Lcha};
pub use luma::{GammaLuma, GammaLumaa, LinLuma, LinLumaa, SrgbLuma, SrgbLumaa};
pub use rgb::{GammaSrgb, GammaSrgba, LinSrgb, LinSrgba, Srgb, Srgba};
pub use rgb::{
GammaSrgb, GammaSrgba, LinSrgb, LinSrgba, PackedAbgr, PackedArgb, PackedBgra, PackedRgba, Srgb,
Srgba,
};
pub use xyz::{Xyz, Xyza};
pub use yxy::{Yxy, Yxya};

Expand Down
3 changes: 2 additions & 1 deletion palette/src/rgb/mod.rs
Expand Up @@ -6,9 +6,10 @@ use crate::encoding::{self, Gamma, Linear, TransferFn};
use crate::white_point::WhitePoint;
use crate::{Component, FloatComponent, FromComponent, Yxy};

pub use self::packed::{PackedAbgr, PackedArgb, PackedBgra, PackedRgba};
pub use self::rgb::{Rgb, Rgba};

//mod linear;
mod packed;
mod rgb;

/// Nonlinear sRGB.
Expand Down

0 comments on commit 813ea12

Please sign in to comment.