Files
imhex/lib/libimhex-rs/src/imhex_api.rs
jam1garner 57e1f7ee10 Rework libimhex-rs to use autocxx (#451)
* Rework libimhex-rs to use autocxx

* Remove Bookmarks::add overload

* Remove manual usage of cxx-rs
2022-02-20 19:14:11 -05:00

18 lines
388 B
Rust

/// A highlight color for use with the bookmarks API
pub struct Color {
pub a: u8,
pub g: u8,
pub b: u8,
pub r: u8,
}
impl Color {
pub const fn new(r: u8, g: u8, b: u8, a: u8) -> Self {
Color { a, g, b, r }
}
pub const fn rgba(self) -> u32 {
(self.a as u32) << 24 | (self.b as u32) << 16 | (self.g as u32) << 8 | (self.r as u32) << 0
}
}