I would like to have a PHP function that creates different shades of a specified color in RGB.
The PHP function should take in 4 variables.
1. RGB array (Example: R=57, G=125 and B=57)
2. Total number of shades (Example: 10)
3. Change percentage between each shade (Example: 7.5%)
4. Type of shades (lighter or darker)
The function should generate different shades of colors based on the above inputs.
And I need another function to determine the color that's closest to a predefined color in RGB.
So if I have an array of 10 different RGB values, and I set a predefined color in RGB, the function must be able to compare the 10 RGB values in the array against the predefined color and select the color that's closest to it.
Programmers who are able to demonstrate a working code will be awarded.