colourpicker

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

Commit: baa8319e3b3bb4f1e2f36cbcc3f5c24229cfa9d6
Parent: 66ed950cda2ba7e8b5e767785c30d4ccd31791e1
Author: Randy Palamar
Date:   Thu,  1 Aug 2024 06:48:48 -0600

don't segfault when window system can't get clipboard text

Diffstat:
Mcolourpicker.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/colourpicker.c b/colourpicker.c @@ -1187,7 +1187,8 @@ do_colour_picker(ColourPickerCtx *ctx, f32 dt, Vector2 window_pos, Vector2 mouse SetClipboardText(txt); break; case 1: - txt = (char *)GetClipboardText(); + txt = (char *)GetClipboardText(); + if (!txt) break; new_colour = normalize_colour(parse_hex_u32(txt)); store_formatted_colour(ctx, new_colour, CM_RGB); if (ctx->mode == CPM_PICKER) {