colourpicker

Simple Colour Picker written in C
git clone anongit@rnpnr.xyz:colourpicker.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

Commit: 1e2b6e42c462028c4a890c2a17b19251e812ecef
Parent: ad7d7f55eea08912fdb7e516f2263539ebe4726d
Author: Randy Palamar
Date:   Fri,  9 Aug 2024 00:13:19 -0600

add a basic icon

Diffstat:
Mmain.c | 18+++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c @@ -152,9 +152,25 @@ main(i32 argc, char *argv[]) SetConfigFlags(FLAG_VSYNC_HINT); InitWindow(ctx.window_size.w, ctx.window_size.h, "Colour Picker"); /* NOTE: do this after initing so that the window starts out floating in tiling wm */ - SetWindowMinSize(320, 320 * WINDOW_ASPECT_RATIO); + SetWindowMinSize(324, 324 * WINDOW_ASPECT_RATIO); SetWindowState(FLAG_WINDOW_RESIZABLE); + { + Image icon; + RenderTexture icon_texture = LoadRenderTexture(48, 48); + BeginDrawing(); + BeginTextureMode(icon_texture); + ClearBackground(ctx.bg); + DrawCircleGradient(24, 24, 16, colour_from_normalized(hsv_to_rgb(ctx.colour)), ctx.bg); + DrawRing((Vector2){24, 24}, 13, 16, 0, 360, 32, BLACK); + EndTextureMode(); + EndDrawing(); + icon = LoadImageFromTexture(icon_texture.texture); + SetWindowIcon(icon); + UnloadRenderTexture(icon_texture); + UnloadImage(icon); + } + ctx.font = LoadFont_lora_sb_0_inc(); ctx.font_size = ctx.font.baseSize;