Skip to content

Instantly share code, notes, and snippets.

View Aeldrion's full-sized avatar

Aeldrion

View GitHub Profile
@Aeldrion
Aeldrion / RGB-HSV conversions.fsh
Last active December 30, 2023 10:37
GLSL functions for HSV to RGB and RGB to HSV conversion
vec3 hsv_to_rgb(vec3 color) {
// Translates HSV color to RGB color
// H: 0.0 - 360.0, S: 0.0 - 100.0, V: 0.0 - 100.0
// R, G, B: 0.0 - 1.0
float hue = color.x;
float saturation = color.y;
float value = color.z;
float c = (value/100) * (saturation/100);