Package: colorpedia
ColorpediaColorpediais a command-line tool for looking up colors, shades and palettes.Supportedcolor models:
HEX, RGB, HSL, HSV, CMYK.RequirementsModern terminal with true color and utf-8 support
(e.g. Windows Terminal, PowerShell, iTerm2, Terminator)Python 3.6+InstallationInstall viapip:pipinstallcolorpediaForcondausers:condainstallcolorpedia-cconda-forgeYou can then use thecolorcommand:color--helpIf you have a name collision on Windows, usecolorpediainstead:colorpedia--helpUsageLook up colors using various color models:colornamegreen# CSS3 color namecolorhexFFFFFF# hex code without the hash (#) prefixcolorrgb255255255# RGB (Red Green Blue)colorhsl360100100# HSL (Hue Saturation Lightness)colorhsv360100100# HSV (Hue Saturation Brightness)colorcmyk100100100100# CMYK (Cyan Magenta Yellow Black)Use--shadesto display shades of a color:colornamegreen--shades# Display 15 colors by defaultcolorhexFFFFFF--shades=5# Display 5 shadesLook up color palettes:colorpalettemolokai
colorpalettefacebook
colorpalettezenburnControl the output with global flags:colornameyellow--all# Display all detailscolornameyellow--json# Display in JSON formatcolornameyellow--units# Display unit symbolscolornameyellow--nojson# Do not display in JSONcolornameyellow--nounits# Do not display unit symbolsCombine with other command-line tools likejq:colorpalettemolokai|cut-d'|'-f2,3,4
colornameblue--range--json|jq.[0].nameUse--helpto display more information on each subcommand:colorname--help
colorrgb--help
colorpalette--helpTab CompletionFor Bash, add the following line in~/.bashrcor~/.bash_profile:source<(color----completion)For Zsh, add the following lines in~/.zshrc:autoload-U+Xcompinit&&compinit
autoload-U+Xbashcompinit&&bashcompinitsource<(color----completion|sed"s/:/: /g")Replacecolorwithcolorpediaif you are using the latter.ConfigurationInitialize the configuration file to customize CLI behavior:colorconfiginitThe command above creates~/.config/colorpedia/config.jsonwith default settings:{// Always display in JSON format. Use with --nojson global flag."always_output_json":false,// Suffix for approximate color names (e.g. "green~")."approx_name_suffix":"~",// Default number of shades displayed when --shades is used without a count."default_shades_count":15,// Display degrees angle (°) symbol. Use with --nounits global flag."display_degree_symbol":false,// Display percentage (%) symbol. Use with --nounits global flag."display_percent_symbol":false,// Height of the color box displayed in single-color (get) view."get_view_color_height":10,// Width of the color box displayed in single-color (get) view."get_view_color_width":20,// Keys displayed in single-color (get) view."get_view_keys":["name","hex","rgb","color","hsl","hsv","cmyk"],// Keys displayed in JSON view."json_keys":["name","is_name_exact","hex","rgb","hsl","hsv","cmyk"],// Width of the color box displayed in multi-color (list) view."list_view_color_width":20,// Keys displayed in multi-color (list) view."list_view_keys":["name","hex","rgb","color","hsl","hsv","cmyk"],// Always uppercase hex codes if set to true, lowercase if set to false."uppercase_hex_codes":true}Display or edit the configuration file:colorconfigshow# Display configurationcolorconfigedit# Edit configuration via a text editorTechnical NotesNames of "unknown" colors are approximated using minimum RGB delta:delta = (R1 - R2) ^ 2 + (G1 - G2) ^ 2 + (B1 - B2) ^ 2If there is are ties, all names are included in the output.Percentage values use 0 - 100 scale by default, 0 - 1 scale in JSON.Degree angles use 0 - 360 scale by default, 0 - 1 scale in JSON.Percent and degree unit symbols are omitted in JSON.If HSV/HSL/CMYK values do not map exactly to an RGB triplet, they are rounded to the
nearest one.