Answer the question
In order to leave comments, you need to log in
How to determine if two or more colors are similar?
There are several colors. Let's say 1 purple, 2 pink, 3 red, 4 blue. Their values are set in RGB format
. There is a base color, for example, burgundy.
The task is to arrange the colors in descending order of their similarity to the base. Similarities from the point of view of a normal person (not colorblind).
For example, for burgundy it is red>pink>purple>blue.
And by what algorithm does this person do it? It is necessary to simulate such an algorithm on a computer. It is clear that there are different people and the algorithm may differ in weighting factors. But how to do it in general?
Can you post links to read about this?
Answer the question
In order to leave comments, you need to log in
Color difference formula , also color difference formula , color difference , or color distance (distance between colors) is a mathematical representation that allows you to numerically express the difference between two colors in colorimetry.
IMHO: this is a combination of the position of the color in the rainbow, brightness and saturation
RBG > HSL and sort by all three keys: hue, saturation and lightness
Distance on 3 channels: R, G, B (transparency - optional)
_base - these are the channels of the base (reference, reference) color, against which we check.
R, G, B - channels of the checked color:
R=abs(Rbase-R)
G=abs(Gbase-G)
B=abs(Bbase-B)
D=(sqrt(R^2+G^2)+sqrt(G^2+B^2)+sqrt(B^2+R^2))/3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question