mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
* Rework libimhex-rs to use autocxx * Remove Bookmarks::add overload * Remove manual usage of cxx-rs
18 lines
388 B
Rust
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
|
|
}
|
|
}
|