Skip to content

Instantly share code, notes, and snippets.

@crittericallyonline
crittericallyonline / interpolateHex.c
Last active May 14, 2026 18:11
Easing between 2 hex codes
#include "interpolateHex.h"
#define interpolate(x, a, b) (((b)-(a))*(x)+(b))
#define clamp(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
#define UCHAR_MAX 255.0
typedef union {
unsigned char byte[4];
unsigned int rgba;
} color_t;