Skip to content

Commit c7227f6

Browse files
authored
rgui: gui_color_picker now mutates color like the ffi one (#196)
1 parent e2be94b commit c7227f6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

raylib/src/rgui/safe.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -632,13 +632,12 @@ pub trait RaylibDrawGui {
632632
&mut self,
633633
bounds: impl Into<ffi::Rectangle>,
634634
text: &str,
635-
color: impl Into<ffi::Color>,
636-
) -> Color {
637-
let mut out = color.into();
635+
color: &mut Color,
636+
) -> i32 {
638637
let c_text = CString::new(text).unwrap();
639638

640-
let _result = unsafe { ffi::GuiColorPicker(bounds.into(), c_text.as_ptr(), &mut out) };
641-
return out.into();
639+
let result = unsafe { ffi::GuiColorPicker(bounds.into(), c_text.as_ptr(), &mut *color) };
640+
return result;
642641
}
643642
// Get text with icon id prepended
644643
// NOTE: Useful to add icons by name id (enum) instead of

0 commit comments

Comments
 (0)