pub fn with_color_vars<F: FnOnce()>(&self, color_vars: &[(StyleColor, [f32; 4])], f: F) {
        for &(color_var, color) in color_vars {
            unsafe {
                sys::igPushStyleColor(color_var as _, color.into());
            }
        }
        f();
        unsafe { sys::igPopStyleColor(color_vars.len() as i32) };
    }
/// Runs a function after temporarily pushing an array of values to the color stack.
///
/// # Example
/// ```rust,no_run
/// # use imgui::*;
/// # let mut imgui = Context::create();
/// # let ui = imgui.frame();
/// let red = [1.0, 0.0, 0.0, 1.0];
/// let green = [0.0, 1.0, 0.0, 1.0];
/// # let vars = [(StyleColor::Text, red), (StyleColor::TextDisabled, green)];
/// ui.with_color_vars(&vars, || {
///     ui.text_wrapped(im_str!("AB"));
/// });
/// ```
Runs a function after temporarily pushing an array of values to the color stack.
Runs a function after temporarily pushing an array of values to the color stack .
pub fn with_color_vars<F: FnOnce()>(&self, color_vars: &[(StyleColor, [f32; 4])], f: F) {
        for &(color_var, color) in color_vars {
            unsafe {
                sys::igPushStyleColor(color_var as _, color.into());
            }
        }
        f();
        unsafe { sys::igPopStyleColor(color_vars.len() as i32) };
    }
pub fn with_color_vars < F : FnOnce ( ) > ( & self , color_vars : & [ ( StyleColor , [ f32 ; 4 ] ) ] , f : F ) { for & ( color_var , color ) in color_vars { unsafe { sys :: igPushStyleColor ( color_var as _ , color . into ( ) ) ; } } f ( ) ; unsafe { sys :: igPopStyleColor ( color_vars . len ( ) as i32 ) } ; }
Runs a function after temporarily pushing an array of values to the color stack.
Runs a function after temporarily pushing an array of values to the color stack .
&self
color_vars
&[(StyleColor, [f32; 4])]
f
F
example
None
use imgui::*;
None
let mut imgui = context::create();
None
let ui = imgui.frame();
None
let vars = [(stylecolor::text, red), (stylecolor::textdisabled, green)];
None