如何以编程方式在 2D 中排列一组 256 种 RGB 颜色,以便所有相邻颜色都有平滑过渡
我有一组 256 种颜色(xterm-256color 终端中的所有可用颜色),并且我正在使用一个名为 256colors2.pl 的脚本,我在几乎所有谈论 256 色终端的互联网文章中都看到了该脚本。该脚本的输出是一个 6x6x6 颜色立方体,布局为一系列 6 个 6x6 立方体切片,加上一条从黑到白的灰色线。
我正在寻找的是一些 2D 形状,以及相应的算法来以 2D 布局这些颜色,以便所有过渡都很平滑。这应该适用于减少的颜色集(在本例中为 256 种颜色,其中包括有限的灰色集)。
I have a set of 256 colors (all available colors in an xterm-256color terminal) and I am using a script called 256colors2.pl that I see mentioned in nearly every Internet article that talks about 256 color terminals. This is script's output is a 6x6x6 color cube laid out as a series of 6 6x6 slices of the cube, plus a line with grays from black to white.
What I am looking for is some 2D shape, and the corresponding algorithm to lay out these colors in 2D so that all the transitions are smooth. This should be applicable to a reduced set of colors (256 in this case, which includes a limited set of grays).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是一个想法(我没有这方面的技术解决方案或算法)......您可能需要考虑色轮。当用户想要选择颜色时,它通常用于图形和成像应用程序。
参考:http://en.wikipedia.org/wiki/Color_wheel
以下是一些相关帖子:
Just a thought (I don't have a technical solution or algorithm for this)... you'd probably want to consider a color wheel. It's commonly used in graphic and imaging applications when the user wants to select a color.
Reference: http://en.wikipedia.org/wiki/Color_wheel
Here are some related posts: