I have a function from an external library [1] like
fn set_color(r: f64, g: f64:, b: f64)
I would like to manage my colors in tuples like
let yellow = (1., 1., 0.);
I thought of a macro like:
macro_rules! rgb {
( $rgb:expr ) => { rgb.0, rgb.1, rgb.2 }
}
and then
set_color(rgb!(yellow));
Unfortunately Rust then says: error: macro expansion ignores token ',' and any following.
How can I make this happen?
[1]: cairo::Context::set_source_rgb() and friends