[Python] CLI tool to get a color close to the selected one
usage: rgb_to_256_color.py [-h]
-a {closest_rgb_color,closest_256_color,term256_to_rgb,rgb_to_term256}
-c COLOR
Script to get closest color from the palette.
optional arguments:
-h, --help show this help message and exit
-a {closest_rgb_color,closest_256_color,term256_to_rgb,rgb_to_term256}, --action {closest_rgb_color,closest_256_color,term256_to_rgb,rgb_to_term256}
Mode to get color.
-c COLOR, --color COLOR
Color RGB or 256term ("256,76,98" or "#ff54e1" or "13")
$ ./rgb_to_256_color.py -a term256_to_rgb -c 13
((255, 0, 255), '#ff00ff')
$ ./rgb_to_256_color.py -a rgb_to_term256 -c "255,0,255"
13
$ ./rgb_to_256_color.py -a rgb_to_term256 -c "#ff00ff"
13
$ ./rgb_to_256_color.py -a closest_rgb_color -c "#ff22ff"
((255, 0, 255), '#ff00ff')
$ ./rgb_to_256_color.py -a closest_256_color -c "#ff22ff"
13