Skip to content

[Python] CLI tool to get a color close to the selected one

License

Notifications You must be signed in to change notification settings

shotInLeg/RgbTo256Color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RgbTo256Color

[Python] CLI tool to get a color close to the selected one

Help

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")

Examples

Term256 color to RGB

$ ./rgb_to_256_color.py -a term256_to_rgb -c 13
((255, 0, 255), '#ff00ff')

RGB to Term256

$ ./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

Closest RGB color

$ ./rgb_to_256_color.py -a closest_rgb_color -c "#ff22ff"
((255, 0, 255), '#ff00ff')

Closest Term256 color

$ ./rgb_to_256_color.py -a closest_256_color -c "#ff22ff"
13

About

[Python] CLI tool to get a color close to the selected one

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages