I\'m looking for a Algorithm/Way to convert given HEX (e.g. #111111 R:0x11, G:0x11, B:0x11) to the closest X11 color number (Terminal is either 88 or 256 colors) using either Py
Once you know the RGB values of the X11 colors, you can determine to which of those colors a given input color is "nearest".
There is a good, quick measure of color distance here
https://stackoverflow.com/a/74033/141172