refactor things around
This commit is contained in:
parent
a99e19de4b
commit
f0d752570b
|
@ -34,17 +34,15 @@ impl From<Color> 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_export]
|
||||||
macro_rules! color {
|
macro_rules! rgb {
|
||||||
($r:expr, $g:expr, $b:expr, $a:expr) => {
|
($r:expr, $g:expr, $b:expr, $a:expr) => {
|
||||||
$crate::color::Color($r, $g, $b, $a)
|
$crate::color::Color($r, $g, $b, $a)
|
||||||
};
|
};
|
||||||
($r:expr, $g:expr, $b:expr) => {
|
($r:expr, $g:expr, $b:expr) => {
|
||||||
$crate::color::Color($r, $g, $b, 1.0)
|
$crate::color::Color($r, $g, $b, 1.0)
|
||||||
};
|
};
|
||||||
// ($rgba:expr) => {
|
($rgba:expr) => {
|
||||||
// $crate::color::Color::from_rgba($rgba)
|
$crate::color::Color::from_rgba($rgba)
|
||||||
// };
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
//! Able GUI Toolkit (AbleTK)
|
//! Able GUI Toolkit (AbleTK)
|
||||||
#[doc(inline)] pub use abletk_macros::*;
|
#[doc(inline)] pub use abletk_macros::*;
|
||||||
pub use abletk_common::color;
|
pub use abletk_common::*;
|
||||||
pub mod application;
|
pub mod application;
|
||||||
pub mod context;
|
pub mod context;
|
||||||
pub mod event;
|
pub mod event;
|
||||||
|
@ -26,6 +26,6 @@ pub mod prelude {
|
||||||
pub use crate::widget::Label;
|
pub use crate::widget::Label;
|
||||||
pub use crate::widget::Widget;
|
pub use crate::widget::Widget;
|
||||||
pub use crate::window::*;
|
pub use crate::window::*;
|
||||||
pub use crate::color;
|
pub use crate::rgb;
|
||||||
pub use crate::launch;
|
pub use crate::launch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,5 @@ fn launch() -> _ {
|
||||||
.apply_plugin(QuitPlugin)
|
.apply_plugin(QuitPlugin)
|
||||||
.add_window(Window::builder(
|
.add_window(Window::builder(
|
||||||
Label::new("Hello, AbleTK!")
|
Label::new("Hello, AbleTK!")
|
||||||
.color(color!(0xFF00FFFF))))
|
.color(rgb!(0xFF00FFFF))))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue