Simple color management in the terminal

Run colo s <COLOR> to view a color. Colo supports HTML color names, hex colors and 12 different color spaces.

> colo s ff3377

 ████████  #ff3377                    rgb(255, 51, 119)        
 ████████  hsl(-20, 100%, 60%)        hsv(340, 80%, 100%)      
 ████████  cmy(0%, 80%, 53.3%)        cmyk(0%, 80%, 53.3%, 0%) 
 ████████  lch(57, 78.1, 9.2)         luv(57, 136.2, -0.1)     

> colo s orange

 ████████  #ffa500  orange            rgb(255, 165, 0)         
 ████████  hsl(38.8, 100%, 50%)       hsv(38.8, 100%, 100%)    
 ████████  cmy(0%, 35.3%, 100%)       cmyk(0%, 35.3%, 100%, 0%)
 ████████  lch(74.9, 82.5, 73.1)      luv(74.9, 74.9, 74)      

> colo s 'hsv(300, 100%, 100%)'

 ████████  #ff00ff  fuchsia           rgb(255, 0, 255)         
 ████████  hsl(-60, 100%, 50%)        hsv(300, 100%, 100%)     
 ████████  cmy(0%, 100%, 0%)          cmyk(0%, 100%, 0%, 0%)   
 ████████  lch(60.3, 115.6, 328.2)    luv(60.3, 84.1, -108.7)  

>  

12 supported color spaces

Colo supports widely used color spaces, that should cover the needs for professional developers and designers. More information.

Terminal color picker

Pick a color by entering colo pick, and then setting the desired values with the arrow keys, or by entering the values directly. With Tab, you can switch between the sRGB, HSL, HSV and CMY color space. When you’re done, press Enter or Esc.

> colo pick

           HSL
           H  0      
           S  100%   
           L  50%    

The pick keyword can also be used in different context to select a color with the color picker. - can be used to read a color from stdin, e.g.

> colo s - pick --size=0
Enter color: 147

           HSL
           H  40     
           S  100%   
           L  50%    

██  #114477  rgb(17, 68, 119)           hsl(210, 75%, 26.7%)     
██  #ffaa00  rgb(255, 170, 0)           hsl(40, 100%, 50%)       
>  

Press S to toggle the rectangle mode. This displays a rectangle with one slider as x-axis and another slider as y-axis:

> colo pick

           HSL
           H  30      
           S  90%     
                      
                      
                      
                      
                      
                      
                      
                      
                      
                      
                      
                      
                      
           L  50%    
<S>      Toggle mode
<Tab ↹>  Toggle color space

Support for pipes/redirects

Piping data between colo and other commands or files is convenient and enables a wide range of applications.

> echo orange ff4400 | colo s -o hsl > somefile.txt
> cat somefile.txt
hsl(38.8, 100%, 50%)
hsl(16, 100%, 50%)
> colo s < somefile.txt

 ████████  #ffa500  orange            rgb(255, 164.9, 0)       
 ████████  hsl(38.8, 100%, 50%)       hsv(38.8, 100%, 100%)    
 ████████  cmy(0%, 35.3%, 100%)       cmyk(0%, 35.3%, 100%, 0%)
 ████████  lch(74.9, 82.5, 73.1)      luv(74.9, 74.9, 74)      

 ████████  #ff4400                    rgb(255, 68, 0)          
 ████████  hsl(16, 100%, 50%)         hsv(16, 100%, 100%)      
 ████████  cmy(0%, 73.3%, 100%)       cmyk(0%, 73.3%, 100%, 0%)
 ████████  lch(57.5, 96.9, 45.3)      luv(57.5, 151.7, 45.3)   

>  

Mix colors and create gradients

Colors can be mixed in various color spaces. The default color space is lab, because it is designed to approximate human vision.

> colo mix orange blue -w 2,3
Colors:       
Weights: 2, 3

 ████████  #b749af                    rgb(182.9, 72.9, 174.5)  
 ████████  hsl(-55.4, 43.3%, 50.2%)   hsv(304.6, 60.1%, 71.7%) 
 ████████  cmy(28.3%, 71.4%, 31.6%)   cmyk(0%, 0%, 0%, 28.3%)  
 ████████  lch(49.4, 66, 329.9)       luv(49.4, 51.9, -57.2)   

> colo gradient orange blue
                                                                                
>  

colo print <TEXT> <COLORS>... prints text with certain colors applied. There are also flags to make the text bold (-b), italic (-i) or underlined (-u), and a flag to continue printing in the same line (-n):

> colo print 'Hello ' lime -n &&
  colo print 'world!' black lime -ib
Hello world!

>  

Get color contrast

Check the contrast between two colors, and find out if white or black text is better readable on a background color.

> colo textcolor green
  white  
> colo contrast green white
 ████████  5.13
 ████████  (relative luminance: 0.154 / 1.000)
>  

Flexible input

Hex colors can be entered in the formats RGB, RRGGBB, RRRGGGBBB, etc. Colors in different color spaces are entered in the format color_space(value1, value2, value3), for example hsl(30, 100%, 60%). The parentheses and commas are optional, so the following commands are equivalent:

> colo s 'cmy(100%, 50%, 66.7%)'
> colo s cmy 100% 50% 66.7%
> colo s cmy 1 50% 66.7%

Random values can be used anywhere where colors or numbers can be used. For example:

> colo contrast rand rand
 ████████  2.90
 ████████  (relative luminance: 0.055 / 0.255)
> colo s 'hsl(rand, 100%, 50%)'

 ████████  #ff0090                    rgb(255, 0, 144.5)       
 ████████  hsl(326, 100%, 50%)        hsv(326, 100%, 100%)     
 ████████  cmy(0%, 100%, 43.3%)       cmyk(0%, 100%, 43.3%, 0%)
 ████████  lch(55.4, 86, 356.6)       luv(55.4, 134.5, -23.8)  

>  

Show terminal colors

Display the default colors of your terminal.

> colo term
The appearance of these colors depends on your terminal.

     BrightWhite      White        BrightWhite     White
     BrightBlack      Black        BrightBlack     Black
     BrightRed        Red          BrightRed       Red
     BrightYellow     Yellow       BrightYellow    Yellow
     BrightGreen      Green        BrightGreen     Green
     BrightCyan       Cyan         BrightCyan      Cyan
     BrightBlue       Blue         BrightBlue      Blue
     BrightMagenta    Magenta      BrightMagenta   Magenta

>