+/* TODO: split this out into a formatless button and one that auto fills */
+enum ui_button_state ui_colourbutton( ui_rect rect,
+ enum ui_scheme_colour colour,
+ enum ui_scheme_colour hover_colour,
+ enum ui_scheme_colour hi_colour )
+{
+ enum ui_button_state state = ui_button_base( rect );
+
+ u32 col_base = vg_ui.scheme[ colour ],
+ col_highlight = vg_ui.scheme[ hi_colour? hi_colour: k_ui_fg ],
+ col_hover = vg_ui.scheme[ hover_colour? hover_colour:
+ colour + k_ui_brighter ];
+
+ if( state == k_ui_button_click )
+ {
+ ui_fill( rect, col_highlight );
+ rect_copy( rect, vg_ui.click_fader );
+ rect_copy( rect, vg_ui.click_fader_end );
+ vg_ui.click_fader_end[3] = 0;
+ ui_rect_center( rect, vg_ui.click_fader_end );
+ vg_ui.click_fade_opacity = 1.0f;
+ }
+ else if( state == k_ui_button_holding_inside )
+ {
+ ui_fill( rect, col_highlight );
+ }
+ else if( state == k_ui_button_holding_outside )
+ {
+ ui_fill( rect, col_base );
+ ui_outline( rect, 1, col_highlight, 0 );
+ }
+ else if( state == k_ui_button_hover )
+ {
+ ui_fill( rect, col_hover );
+ }
+ else ui_fill( rect, col_base );
+
+ return state;
+}
+