I have two arrays, one array contains hex color values, while the other array requires unnecessary hex value and To match the reference array and its value is updated in the reference index.
For example, here is a sample (minor version) of reference that I am checking. [ ] $ ref_array = array (4 = & gt; '000000 ', 66 = & gt; C31 AOC', 162 = & gt; 'Eddy 2823'); And here's the array that needs to match as closely as possible to the reference. $ orig_array = array ('1' => 2b 944 '' 2 = & gt; 2f3136 ', 3 = & gt; '88110d'); They are not in line with the orig_array ref_array
I'm not sure that this is possible in PHP but we say that the first element in the orig_array is a green color The color is and the nearest color in the reference array is 2B 9 44, so a new array will be created in such a way that:
$ new_array ('2be 944' => 4) This holds the value of the orig_array index
How can I do this or something like this?
From the scientific perspective to the case ...
Remember that hex color The code is made up of three 2-digit hex numbers (RGB-value)! You can not do it at one time, because the first two digits will otherwise increase your decimal value significantly ...)
Here's how I will do it.
You can split your color code into 3 parts:
- R = 2b - & gt; 43 Decimal
- G = E 9 - & gt; 233 Decimal
- B = 44 - & gt; 68 decimal
You can then compare each color with references (they can divide them into R / G / B).
If you add a difference, then
However, it has already been told that color perception is a subject matter.
Comments
Post a Comment