Get the color name by hex or rgb code in java

The task is as follows: there is a string containing the color code, for example #75CD5C. There are html color names(about 147 colors in total) , you need to get the hex code to output the color name in html. The task is not difficult if the colors match. But if the color is intermediate, you need to display the name to which it is closest. Something like this: the code comes #F08080 this color corresponds to the html color LightCoral. But if the code #F08081 comes, then the name of this color is not in html, although it is clear that it will be close to the previous color. Tell me, how can all this be implemented programmatically? Maybe there are already ready-made libraries? I will be glad to receive any tips and hints

Author: Arty Mart, 2020-07-05