A math-based color space aims to generate inclusive, diverse skin tones
Original source
Show HN: Simple algorithm and color space to generate diverse skin tones
Hacker News →A developer has released an open-source color space and sampling algorithm designed to produce a broad, realistic range of human skin tones for uses like character creators and digital art. The motivating problem is that existing options sit at unhelpful extremes: emoji offer five shades, makeup brands might offer fifty, and a raw RGB picker dumps all 16.7 million colors on the user. The project tries to define the region of RGB space that corresponds to plausible simplified skin tones, landing somewhere between ‘several’ and ‘several million.’
The approach is deliberately pragmatic rather than scientific. The author manually labeled many RGB colors as plausible or not using a clickable face-shaped UI, which produced a curved, banana-like point cloud running from black to white and skewed toward red. Principal component analysis (N=3) reshaped that data into an easier-to-model form, after which hand-fit equations map a sphere onto the transformed space. The published code includes two point-sampling functions (deterministic and rejection-based uniform sphere sampling) plus a to_rgb conversion, offered in both Python and JavaScript alongside an interactive picker.
The write-up is unusually candid about its limits, labeling the methodology ‘good enough’ engineering rather than authoritative research. Skin is never a single color, and perception shifts with blood flow, melanin, lighting, display calibration, and conditions like vitiligo, argyria, or jaundice; the author, a solo non-researcher, also flags their own subjective color judgments. The piece closes by situating the technical work in the social context of colorism and racism, pointing readers to essays and videos on how darker skin tones have historically been marginalized in representation.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.