且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何找到两种颜色之间的所有颜色?

更新时间:2023-02-26 20:34:43

除非你真的知道 kind 你需要哪些颜色,这几乎不可能在两种颜色之间获得所有颜色。

Unless you really know what kind of colors do you need, this is almost impossible to get all the colors between two colors.

只要看看颜色的表示 - 那里是这样颜色的***:

Just look at the representations of the colors - there are wheels with colors like that:

您可以在某条直线上选择颜色,顺时针或逆时针,您会得到不同的结果。

and you can pick colors on some straight line, going clockwise or counter-clockwise and you will get different results.

在RGB颜色的情况下,它们的数量是有限的并且等于16 777 216(245 ^ 3)。但你真的想要挑选所有这些颜色吗?选择一种方法来区分两种颜色之间的颜色,然后只需应用它并找到这些中间颜色。在两种不同颜色之间选择颜色没有单一且唯一的***方法。

In case of RGB colors, their number is limites and is equal to 16 777 216 (245^3). But do you really want to pick all of these colors? Choose a method to distinguish colors "between" two other colors and then just apply it and find these intermediate colors. There is no "single and only" best method to pick colors 'between' two different colors.

编辑:

或者,您可以使用色差概念并且选择比这两种基色更接近的所有颜色都比这些基色更接近。但我会给你所有的计算。

Alternatively, you can just make use of Color Difference concept and pick all the colors that are closer to both base colors than these base colors are close to each other. But I will leave you all the calculations.