← Retour au blog
tech 4 August 2026

Creating Diverse Skin Tones: A Simple Algorithm and Innovative Color Space

Discover how a simple algorithm and a well-designed color space can generate a diverse and inclusive palette of skin tones. This project aims to enhance representation in digital tools.

Article inspired by the original source
Show HN: Simple algorithm and color space to generate diverse skin tones ↗ toneyalexander.github.io

Introduction: The Importance of Diversity in Skin Tones

In an increasingly digital world, visual representation plays a crucial role. Whether for character creators in video games, digital artists, or even marketing tools, the ability to faithfully represent the diversity of skin tones is essential. However, most current digital tools fail to capture the complexity and richness of human skin tones. This is where Toney Alexander's project comes in, proposing a simple algorithm and innovative color space to generate diverse skin tones.

Understanding the Algorithm and Color Space

The algorithm uses a mathematical approach to uniformly sample points on a sphere, which are then converted into RGB (Red, Green, Blue) values. This method allows for creating a range of colors that cover a broader spectrum of skin tones than what is typically available.

Python Algorithm

The implementation uses the math library to perform advanced geometric calculations. Here's a glimpse of the code:

``python def select_point(r_square: float = 2.) -> tuple[float, float, float]: radius = r_square (1. / 2) phi = uniform(0, 2 math.pi) costheta = uniform(-1, 1) n = uniform(0, 1) theta = math.acos(costheta) r = radius (n (1.0 / 3)) t = r math.sin(theta) math.cos(phi) u = r math.sin(theta) math.sin(phi) v = r * math.cos(theta) return (t, u, v) ``

The above code demonstrates how the algorithm uniformly samples points on a sphere, a crucial starting point for generating varied skin tones.

Why a Specific Color Space?

Using a dedicated color space allows for better representation of the subtle nuances of skin tones. Unlike traditional color palettes, this color space maximizes inclusivity by minimizing the inherent biases of standard color selection methods.

Practical Applications

  1. Character Creators: Video game developers can integrate this algorithm to offer more customization options to users.
  2. Digital Art: Artists can use this palette to enrich their art with a more accurate representation of human diversities.
  3. Digital Marketing: Marketing tools can adopt this color space to produce more inclusive campaigns.

Limitations and Future Improvements

While this project is a significant step forward, it is important to note that limitations remain. For example, the algorithm does not account for subtle variations caused by lighting or cultural context. However, it is a promising starting point for future research.

Conclusion

In conclusion, Toney Alexander's project offers an innovative solution for inclusivity in the digital representation of skin tones. With varied applications in video games, art, and marketing, it is a powerful tool for better representation.

Let's discuss your project in 15 minutes.

skin tones color space algorithm digital representation inclusivity
Deepthix newsletter · 100% AI · every Monday 8am

An AI agent reads tech for you.

Our AI agent scans ~200 sources per week and ships the best articles to your inbox Monday 8am. Free. One click to unsubscribe.

Visit the newsletter page →

Want to automate your operations?

Let's talk about your project in 15 minutes.

Book a call