pub struct Color { /* private fields */ }Expand description
Typed color parsed from hex (e.g., #RRGGBB or #AARRGGBB).
Implementations§
Source§impl Color
impl Color
Sourcepub const fn r(&self) -> u8
pub const fn r(&self) -> u8
Examples found in repository?
examples/v04_typed.rs (line 11)
4fn main() {
5 println!("=== r-resources v0.4.0 (typed resources) ===\n");
6
7 // Color typed from resources (build-generated)
8 let c = color_t::ACCENT;
9 println!(
10 "Color rgba=({}, {}, {}, {}) rgba_u32=0x{:08X}",
11 c.r(),
12 c.g(),
13 c.b(),
14 c.a(),
15 c.to_rgba_u32()
16 );
17
18 // URL typed from resources (build-generated)
19 let api = url_t::API_BASE;
20 println!("Url: {}://{}{}", api.scheme(), api.host(), api.path());
21}Sourcepub const fn g(&self) -> u8
pub const fn g(&self) -> u8
Examples found in repository?
examples/v04_typed.rs (line 12)
4fn main() {
5 println!("=== r-resources v0.4.0 (typed resources) ===\n");
6
7 // Color typed from resources (build-generated)
8 let c = color_t::ACCENT;
9 println!(
10 "Color rgba=({}, {}, {}, {}) rgba_u32=0x{:08X}",
11 c.r(),
12 c.g(),
13 c.b(),
14 c.a(),
15 c.to_rgba_u32()
16 );
17
18 // URL typed from resources (build-generated)
19 let api = url_t::API_BASE;
20 println!("Url: {}://{}{}", api.scheme(), api.host(), api.path());
21}Sourcepub const fn b(&self) -> u8
pub const fn b(&self) -> u8
Examples found in repository?
examples/v04_typed.rs (line 13)
4fn main() {
5 println!("=== r-resources v0.4.0 (typed resources) ===\n");
6
7 // Color typed from resources (build-generated)
8 let c = color_t::ACCENT;
9 println!(
10 "Color rgba=({}, {}, {}, {}) rgba_u32=0x{:08X}",
11 c.r(),
12 c.g(),
13 c.b(),
14 c.a(),
15 c.to_rgba_u32()
16 );
17
18 // URL typed from resources (build-generated)
19 let api = url_t::API_BASE;
20 println!("Url: {}://{}{}", api.scheme(), api.host(), api.path());
21}Sourcepub const fn a(&self) -> u8
pub const fn a(&self) -> u8
Examples found in repository?
examples/v04_typed.rs (line 14)
4fn main() {
5 println!("=== r-resources v0.4.0 (typed resources) ===\n");
6
7 // Color typed from resources (build-generated)
8 let c = color_t::ACCENT;
9 println!(
10 "Color rgba=({}, {}, {}, {}) rgba_u32=0x{:08X}",
11 c.r(),
12 c.g(),
13 c.b(),
14 c.a(),
15 c.to_rgba_u32()
16 );
17
18 // URL typed from resources (build-generated)
19 let api = url_t::API_BASE;
20 println!("Url: {}://{}{}", api.scheme(), api.host(), api.path());
21}Sourcepub const fn to_rgba_u32(&self) -> u32
pub const fn to_rgba_u32(&self) -> u32
Examples found in repository?
examples/v04_typed.rs (line 15)
4fn main() {
5 println!("=== r-resources v0.4.0 (typed resources) ===\n");
6
7 // Color typed from resources (build-generated)
8 let c = color_t::ACCENT;
9 println!(
10 "Color rgba=({}, {}, {}, {}) rgba_u32=0x{:08X}",
11 c.r(),
12 c.g(),
13 c.b(),
14 c.a(),
15 c.to_rgba_u32()
16 );
17
18 // URL typed from resources (build-generated)
19 let api = url_t::API_BASE;
20 println!("Url: {}://{}{}", api.scheme(), api.host(), api.path());
21}pub const fn to_rgb_tuple(&self) -> (u8, u8, u8)
Trait Implementations§
impl Copy for Color
impl Eq for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more