index.md - sites - public wiki contents of suckless.org
(HTM) git clone git://git.suckless.org/sites
(DIR) Log
(DIR) Files
(DIR) Refs
---
index.md (960B)
---
1 # Minimum Contrast
2
3 A patch that enforces a minimum contrast ratio.
4
5 ## Description
6
7 Apply the patch and set the `min_contrast_ratio` in `config.h` and the
8 terminal will attempt to enforce this contrast ratio by increasing or
9 decreasing the brightness of the foreground color when needed.
10
11 This is useful when your chosen theme clashes with another program to produce unreadable text.
12
13 You can see the effect with these two bash one liners.
14
15
16 ```
17 for i in {0..255}; do printf "\e[30m\e[48;5;%sm%3d\e[0m " "$i" "$i"; if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then echo; fi; done
18 ```
19
20 ```
21 for i in {0..255}; do printf "\e[48;5;%sm%3d\e[0m " "$i" "$i"; if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then echo; fi; done
22 ```
23
24 ### Before and After
25
26  
27
28 ## Download
29
30
31 [st-minimumcontrast-20241029-0.9.2.diff](st-minimumcontrast-20241029-0.9.2.diff)
32
33
34 ## Author
35
36 Nick Lott - <nick.lott@gmail.com>