Skip to content

Instantly share code, notes, and snippets.

View R3tr0BoiDX's full-sized avatar
🖨️
Low on cyan!

R3tr0BoiDX R3tr0BoiDX

🖨️
Low on cyan!
  • Germany
View GitHub Profile
@R3tr0BoiDX
R3tr0BoiDX / hsv2rgb.c
Last active July 22, 2022 23:02 — forked from postspectacular/hsv2rgb.ino
C port of postspectacular's super compact HSV/RGB conversions for Arduino/C
float fract(float x) { return x - (int) x; }
float mix(float a, float b, float t) { return a + (b - a) * t; }
float step(float e, float x) { return x < e ? 0.0f : 1.0f; }
float constrain(float x, float low, float high) { return ((x) < (low) ? (low) : ((x) > (high) ? (high) : (x))); }
float min(float a, float b) { return (a > b) ? b : a; }