use super::button::ColorButton;
use super::edit::{ColorEdit3, ColorEdit4};
use super::flags::ColorEditOptions;
use super::picker::{ColorPicker3, ColorPicker4};
use crate::sys;
use crate::ui::Ui;
use std::borrow::Cow;
impl Ui {
#[doc(alias = "SetColorEditOptions")]
pub fn set_color_edit_options(&self, options: impl Into<ColorEditOptions>) {
let options = options.into();
options.validate("Ui::set_color_edit_options()");
unsafe { sys::igSetColorEditOptions(options.bits() as i32) }
}
#[doc(alias = "ColorEdit3")]
pub fn color_edit3(&self, label: impl AsRef<str>, color: &mut [f32; 3]) -> bool {
self.color_edit3_config(label.as_ref(), color).build()
}
#[doc(alias = "ColorEdit4")]
pub fn color_edit4(&self, label: impl AsRef<str>, color: &mut [f32; 4]) -> bool {
self.color_edit4_config(label.as_ref(), color).build()
}
#[doc(alias = "ColorPicker3")]
pub fn color_picker3(&self, label: impl AsRef<str>, color: &mut [f32; 3]) -> bool {
self.color_picker3_config(label.as_ref(), color).build()
}
#[doc(alias = "ColorPicker4")]
pub fn color_picker4(&self, label: impl AsRef<str>, color: &mut [f32; 4]) -> bool {
self.color_picker4_config(label.as_ref(), color).build()
}
#[doc(alias = "ColorButton")]
pub fn color_button(&self, desc_id: impl AsRef<str>, color: [f32; 4]) -> bool {
self.color_button_config(desc_id.as_ref(), color).build()
}
pub fn color_edit3_config<'ui, 'p>(
&'ui self,
label: impl Into<Cow<'ui, str>>,
color: &'p mut [f32; 3],
) -> ColorEdit3<'ui, 'p> {
ColorEdit3::new(self, label, color)
}
pub fn color_edit4_config<'ui, 'p>(
&'ui self,
label: impl Into<Cow<'ui, str>>,
color: &'p mut [f32; 4],
) -> ColorEdit4<'ui, 'p> {
ColorEdit4::new(self, label, color)
}
pub fn color_picker3_config<'ui, 'p>(
&'ui self,
label: impl Into<Cow<'ui, str>>,
color: &'p mut [f32; 3],
) -> ColorPicker3<'ui, 'p> {
ColorPicker3::new(self, label, color)
}
pub fn color_picker4_config<'ui, 'p>(
&'ui self,
label: impl Into<Cow<'ui, str>>,
color: &'p mut [f32; 4],
) -> ColorPicker4<'ui, 'p> {
ColorPicker4::new(self, label, color)
}
pub fn color_button_config<'ui>(
&'ui self,
desc_id: impl Into<Cow<'ui, str>>,
color: [f32; 4],
) -> ColorButton<'ui> {
ColorButton::new(self, desc_id, color)
}
}