<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/show-hn-simple-algorithm-and-color-space-to-generate-diverse-skin-tones-owydjgsgq" -->

---
title: Show HN: Simple algorithm and color space to generate...
description: A developer built a custom color space (TUV) for representing human skin tones in digital art and game development. The methodology involved manually labeling...
canonical: https://daily.dev/posts/show-hn-simple-algorithm-and-color-space-to-generate-diverse-skin-tones-owydjgsgq
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Show HN: Simple algorithm and color space to generate diverse skin tones | daily.dev
og:description: A developer built a custom color space (TUV) for representing human skin tones in digital art and game development. The methodology involved manually labeling...
og:url: https://daily.dev/posts/show-hn-simple-algorithm-and-color-space-to-generate-diverse-skin-tones-owydjgsgq
og:image: https://api.daily.dev/og/posts/OwydJGsGq.png
og:image:alt: Show HN: Simple algorithm and color space to generate diverse skin tones
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Show HN: Simple algorithm and color space to generate diverse skin tones

**[Hacker News](https://daily.dev/sources/hn)** · 19 min read · 0 upvotes · 0 comments

## Summary

A developer built a custom color space (TUV) for representing human skin tones in digital art and game development. The methodology involved manually labeling RGB colors as plausible skin tones, applying principal component analysis (PCA) to reshape the dataset, then fitting a spherical equation to the transformed data via guess-and-check in Desmos 3D. The resulting TUV space has three intuitive axes (deep/fair, flushed/ochre, cool/warm) that emerged naturally from PCA. A single R² parameter controls variation range, making it easy to tune for different contexts. Sample Python and JavaScript code is provided for both a color picker UI and a procedural generation algorithm. The post acknowledges significant limitations including subjectivity, display inconsistency, and the inherent complexity of real skin tones.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://toneyalexander.github.io/inclusive-color-space>

## Community take

How the wider developer community reacted, aggregated from 2 discussions and 94 comments across hackernews (as of 2026-08-05).

**TL;DR:** The community is broadly enthusiastic about the project's clever use of PCA and custom color space for skin tone generation, praising its practical utility for game dev and digital art; a small number of comments veer into political sniping about diversity, but these are largely drowned out by genuine technical engagement.

**Sentiment:** 72% positive · 18% mixed · 10% skeptical

**The case for**

- The TUV color space emerges naturally from PCA, giving it intuitive, physically meaningful axes that artists can reason about.
- The single R² parameter makes it easy to tune the range for different contexts, from realistic characters to fantasy creatures.
- Providing MIT-licensed Python and JavaScript code makes the work immediately usable in real projects.
- The interactive 3D picker is seen as a compelling alternative to the fixed swatches common in character creators.
- The author's transparent acknowledgment of bias in manual labeling and other limitations is appreciated as intellectually honest.

**The pushback**

- Manual labeling of training data encodes the author's personal bias, and no multi-labeler or expert-labeler process was used.
- The space may underrepresent some darker skin tones (e.g., indigenous Australian, Maasai) at lower R² values, requiring the 'outlier' range to cover them.
- Pale/redhead skin variation (e.g., translucency effects) is difficult to express in the current model.
- The model does not account for lighting conditions, which critically affect perceived skin color.
- No reference to established industry standards like the Pantone Skin Tone guide or the Monk Skin Tone Scale was made.

**By community**

- hackernews (positive): Overwhelmingly positive technical reception with rich side-discussions on skin physics, color science, and real-world applications, marred only by a small flame-war over the project's diversity framing.

**Hottest debate:** Whether the project's framing around 'diverse skin tones' constitutes legitimate artistic/technical motivation or unwanted political virtue-signaling.

**Open questions**

- Could the labeling process be made more rigorous with multiple or expert labelers to reduce bias?
- Can the equations be extended to better cover the full range of darker skin tones without requiring a high R² value?
- How would lighting conditions be incorporated, given that perceived skin color changes dramatically with the light source?
- Is there a way to add subsurface scattering or translucency parameters without dramatically increasing mathematical complexity?

**Highlights**

> If you look at my doctoral thesis, in fact skin colour can be parametrised using melanin and haemoglobin concentration; which it means it is indeed (roughly) two dimensional. This allows you to invert the colour of a pixel and identify someone’s chromophore concentration. This is based on previous work of others cited in the thesis. https://discovery.ucl.ac.uk/id/eprint/10093345/
> — [dr\_scully on hackernews · 2 comments](https://news.ycombinator.com/item?id=49171062)

> Love it! I was looking at this a little while ago, and used some of The Pudding's data on makeup/foundation shades (https://pudding.cool/2018/06/makeup-shades/) and plotted it into the Oklab colorspace (https://observablehq.com/@55th/foundation-shades). The shades form themselves into that same crescent as seen in the article.
> — [mbo on hackernews · 1 comments](https://news.ycombinator.com/item?id=49171543)

> This part ( https://toneyalexander.github.io/inclusive-color-space/#pick... ) is especially cool. Would love to see this 3-D picker ability in the many character designers out there, instead of the lame 8 swatches or whatever.
> — [xp84 on hackernews · 1 comments](https://news.ycombinator.com/item?id=49171538)

> I really like the idea of treating a color space as a task-specific optimization rather than something universal. It makes me wonder if we're underusing domain-specific color spaces in procedural generation in general.
> — [peepsick on hackernews](https://news.ycombinator.com/item?id=49174790)

> It's always entertaining to try to understand these things from first principles. Color and skin color in particular are very complex things to measure and model. It's not just a physical quantity, it's also a matter of human perception based on lighting and a host of factors. It seems like some work was done to research existing approaches, but I don't see any reference to Pantone Skin Tones [0]. Without intending to, I've worked on 3 different projects which involved measuring skin tones for makeup applications. The Pantone range is not 100% perfect, but it's pretty well done and easy to understand. There are two axes: a light/dark one, and red-yellow one [1]. [0] https://www.pantone.com/na/en-us/skintone [1] https://cosmeticsbusiness.com/pantone-skintone-guide-80945
> — [s1mon on hackernews · 2 comments](https://news.ycombinator.com/item?id=49172144)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=49170165) · 471 points · 94 comments
- [hackernews](https://news.ycombinator.com/item?id=49147141) · 3 points · 0 comments

## Similar posts on daily.dev

- [Choosing colors \(for developers\)](https://daily.dev/posts/choosing-colors-for-developers--almguv7ft) · RUBYLAND · 7 upvotes · 4 comments

---

Tags: [#python](https://daily.dev/tags/python), [#data-science](https://daily.dev/tags/data-science), [#game-development](https://daily.dev/tags/game-development)

[View this post on daily.dev](https://daily.dev/posts/show-hn-simple-algorithm-and-color-space-to-generate-diverse-skin-tones-owydjgsgq)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Show HN: Simple algorithm and color space to generate diverse skin tones","url":"https://daily.dev/posts/show-hn-simple-algorithm-and-color-space-to-generate-diverse-skin-tones-owydjgsgq","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/show-hn-simple-algorithm-and-color-space-to-generate-diverse-skin-tones-owydjgsgq"},"datePublished":"2026-08-04T16:29:51.840Z","dateModified":"2026-08-05T02:49:11.942Z","description":"A developer built a custom color space (TUV) for representing human skin tones in digital art and game development. The methodology involved manually labeling...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a1a5fb77ee17c89c6ca8802c135bfa4c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a1a5fb77ee17c89c6ca8802c135bfa4c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/show-hn-simple-algorithm-and-color-space-to-generate-diverse-skin-tones-owydjgsgq","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,data-science,game-development","timeRequired":"PT19M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"Show HN: Simple algorithm and color space to generate diverse skin tones"}]}
```

