]> git.mcshandy.xyz Git - picker/commitdiff
Changed the hue spectrum to a cool shifting thing
authorRandy McShandy <randy@mcshandy.xyz>
Mon, 2 Oct 2023 04:41:54 +0000 (23:41 -0500)
committerRandy McShandy <randy@mcshandy.xyz>
Mon, 2 Oct 2023 04:41:54 +0000 (23:41 -0500)
source/config.h
source/rendering.c

index cda34ca6e3fea1b7bf3deec5909b3f5f630b131d..1c5113586da1fbd0a1c11e19897c2854705ecec3 100644 (file)
@@ -2,8 +2,6 @@
 #define __PICKER_CONFIG__
 #include "structs.h"
 
-// Multiple units need to include config.h now
-
 Runtime_Info runtime =
 {
        .framerate = 30,
index aeb706b2046df9fff660b608a2ef6f3cfd9a0a2d..99d929bfd2fa285d8033859c244b2723f2bc9aed 100644 (file)
@@ -265,13 +265,20 @@ int32_t render_vertical_hue_spectrum(Runtime_Info* runtime, SDL_FRect* container
        NULL_CHECK(runtime);
        NULL_CHECK(container);
 
+#if 0
        int bar_y = runtime->active_hsl.h/360.0f*container->h + container->y;
+       int spectrum_shifter = 0;
+#endif
+
+       int spectrum_shifter = runtime->active_hsl.h + 180;
+       int bar_y = container->h/2 + container->y;
+
        SDL_SetRenderDrawColor(mgr.rend, unroll_sdl_color(black));
        SDL_RenderDrawLine(mgr.rend, container->x-16, bar_y, container->w+container->x+16, bar_y);
 
        for (int n = 0; n < (int)container->h; n++)
        {
-               HSL_Color slice_hsl = {((float)n/(float)container->h) * 360, 100, 50};
+               HSL_Color slice_hsl = {spectrum_shifter + (((float)n/(float)container->h) * 360), 100, 50};
                SDL_Color slice_color = hsl_to_rgb (slice_hsl);
 
                SDL_SetRenderDrawColor(mgr.rend, unroll_sdl_color(slice_color));