From 56ad113e764e33d80f854b4f3bf14e549c8f79d9 Mon Sep 17 00:00:00 2001 From: Randy McShandy Date: Sun, 1 Oct 2023 23:41:54 -0500 Subject: [PATCH] Changed the hue spectrum to a cool shifting thing --- source/config.h | 2 -- source/rendering.c | 9 ++++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/config.h b/source/config.h index cda34ca..1c51135 100644 --- a/source/config.h +++ b/source/config.h @@ -2,8 +2,6 @@ #define __PICKER_CONFIG__ #include "structs.h" -// Multiple units need to include config.h now - Runtime_Info runtime = { .framerate = 30, diff --git a/source/rendering.c b/source/rendering.c index aeb706b..99d929b 100644 --- a/source/rendering.c +++ b/source/rendering.c @@ -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)); -- 2.49.0