HSL颜色之间的距离量度 [英] Distance measure between HSL colours

查看:122
本文介绍了HSL颜色之间的距离量度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个程序,允许用户选择RGB中的各种前景色和背景色。我不想让他们选择过于相似的前景和背景,并决定转换为HSL,并使用HSL欧式距离作为检查相似性的一种方式。

I am coding a program that allows a user to choose various foreground and background colours in RGB. I want to not allow them to chose foreground and backgrounds that are too similar and decided to convert to HSL and use HSL euclidean distance as a way to check for similarity.

对HSL空间使用合适的权重(而不对H,S和L权重相等)吗?我浏览过各个站点,但没有找到我需要的确切内容;只是说HSL或HSB比RGB更好。

Is there a good weighting to use for HSL space (rather than equal weighting for H, S and L)? I've looked at various sites and not found the exact thing I need; just things saying that HSL or HSB is better than RGB.

推荐答案

首先将颜色转换为实验室。设计此颜色空间时,要使任意两种颜色之间的矢量差都接近主观距离。

first convert the colors to Lab. This colorspace is designed so that the vectorial difference between any two colors closely approximate a 'subjective distance'.

在颜色管理中,将 delta E值指定为衡量给定颜色转换在感知上的忠实度的度量。只是实验室空间中表示的原始颜色和最终颜色之间的矢量差的大小。

In color management, a 'delta E' value is given as a measure of how perceptually faithful a given color transformation is. it's just the magnitude of the vector difference between original and final colors as expressed in Lab space.

这篇关于HSL颜色之间的距离量度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆