diff --git a/abletk-common/src/color.rs b/abletk-common/src/color.rs index ad9b81d..495e663 100755 --- a/abletk-common/src/color.rs +++ b/abletk-common/src/color.rs @@ -34,17 +34,15 @@ impl From for D2D1_COLOR_F { } } -// fixme: figure out how to tell RGB, RGBA, HSL, HSLA, any of those in -// hexadecimal numbers, etc. apart. #[macro_export] -macro_rules! color { +macro_rules! rgb { ($r:expr, $g:expr, $b:expr, $a:expr) => { $crate::color::Color($r, $g, $b, $a) }; ($r:expr, $g:expr, $b:expr) => { $crate::color::Color($r, $g, $b, 1.0) }; - // ($rgba:expr) => { - // $crate::color::Color::from_rgba($rgba) - // }; + ($rgba:expr) => { + $crate::color::Color::from_rgba($rgba) + }; } diff --git a/src/lib.rs b/src/lib.rs index d6be9c9..0841a2e 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,7 @@ //! Able GUI Toolkit (AbleTK) #[doc(inline)] pub use abletk_macros::*; -pub use abletk_common::color; +pub use abletk_common::*; pub mod application; pub mod context; pub mod event; @@ -26,6 +26,6 @@ pub mod prelude { pub use crate::widget::Label; pub use crate::widget::Widget; pub use crate::window::*; - pub use crate::color; + pub use crate::rgb; pub use crate::launch; } diff --git a/src/main.rs b/src/main.rs index 0758303..1a2d5ac 100755 --- a/src/main.rs +++ b/src/main.rs @@ -15,5 +15,5 @@ fn launch() -> _ { .apply_plugin(QuitPlugin) .add_window(Window::builder( Label::new("Hello, AbleTK!") - .color(color!(0xFF00FFFF)))) + .color(rgb!(0xFF00FFFF)))) }