From: Randy McShandy Date: Mon, 2 Oct 2023 04:41:54 +0000 (-0500) Subject: Changed the hue spectrum to a cool shifting thing X-Git-Url: http://git.mcshandy.xyz/gitweb.cgi?a=commitdiff_plain;h=56ad113e764e33d80f854b4f3bf14e549c8f79d9;p=picker Changed the hue spectrum to a cool shifting thing --- 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));