Answer the question
In order to leave comments, you need to log in
How to convert number to color?
The question sounds strange, I agree. The point is.
There are a certain number of blocks on the page. Each is assigned a certain number (ID, has nothing to do with the DOM). Several blocks can have the same ID. It is required to assign a color to each group of blocks with the same ID. It is necessary that the color be preserved, i.e. was tied to this ID.
Neither the ID (it can be either 10 or 12341532), nor their number (well, let it be no more than 100) is not known in advance.
Those. we need a unique conversion formula, like md5.
It is visually acceptable for blocks with similar but not equal IDs to be approximately the same color.
Any ideas?
Answer the question
In order to leave comments, you need to log in
Вот например https://jsfiddle.net/kal1sha/Ltn9urmd/4/
вместо ID поставите свое число и все.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question