How can I discover optimal colours of contrast?

Solution 1:

I have tried to generate a set of six colors selected for optimal contrast and readability using the following Bash script:

#!/bin/bash

for i in {1..6}
do
    tput setaf $i
    echo 'color ' $i ' ■■■■■■■■■■■■■■■■■■■■■'
done  

The results of running the Bash script are shown below:

enter image description here

These results are quite good compared to the results of selecting colors for optimal contrast and readability manually using a color replacement tool.