]> git.lizzy.rs Git - nothing.git/commitdiff
(#930) Introduce color preview to ColorPicker
authorrexim <reximkut@gmail.com>
Sat, 6 Jul 2019 18:57:44 +0000 (01:57 +0700)
committerrexim <reximkut@gmail.com>
Sat, 6 Jul 2019 18:57:44 +0000 (01:57 +0700)
src/game/level/level_editor/color_picker.c

index d4bae4a4e20cbedb03a8aeb49bf40e8cf38bbc75..b8727ae11c4056d7aa6dfccb98e9f308039b26bf 100644 (file)
@@ -66,6 +66,13 @@ int color_picker_render(const ColorPicker *color_picker,
     trace_assert(camera);
 
     /* TODO(#931): Color Picker sliders don't have any labels */
+    if (camera_fill_rect_screen(
+            camera,
+            rect(0.0f, 0.0f, COLOR_SLIDER_WIDTH, COLOR_SLIDER_HEIGHT),
+            color_picker_rgba(color_picker)) < 0) {
+        return -1;
+    }
+
     for (ColorPickerSlider index = 0; index < COLOR_SLIDER_N; ++index) {
         const Rect slider_rect =
             rect(0.0f, COLOR_SLIDER_HEIGHT * (float) (index + 1),