如何为任何自然数n生成n种不同的颜色

如何为任何自然数n生成n种不同的颜色

本文介绍了如何为任何自然数n生成n种不同的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请说n = 100;如何生成100种视觉上不同的颜色?这在数学上是可能的吗?

Say n = 100; How do I generate 100 visually distinct colors? Is this mathematically possible?

推荐答案

100是很多颜色,但你可以通过稀疏尽可能在HSB或HSL空间中;

100 is a lot of colours, but you might be able to do it by distributing them as sparsely as possible in the HSB or HSL space; doing it in RGB is probably difficult.

例如,你可能决定使用10种不同的色调,4种不同的饱和度和3种不同的亮度设置,最多120种颜色。你需要仔细选择饱和度和亮度值;人眼是复杂和困惑的传感器。如果将颜色空间视为圆锥,则在每个亮度/饱和度水平下可能需要不同数量的色调。

For example, you might decide to use 10 different hues, 4 different saturation levels, and 3 different brightness settings, that would give you up to 120 colours. You'll need to pick the saturation and brightness values carefully; human eyes are complicated and confusing sensors. If you treat the colour space as a cone, you will probably want a different number of hues at each lightness/saturation level.

这里是wikipedia的链接。

Here's a link to the wikipedia entry on HSB.

这篇关于如何为任何自然数n生成n种不同的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 10:47