Browse Source

slightly optimize print256colours

master
Von Random 7 months ago
parent
commit
75da38d8d8
1 changed files with 1 additions and 3 deletions
  1. 1
    3
      print256colours.sh

+ 1
- 3
print256colours.sh View File

@@ -51,9 +51,7 @@ function contrast_colour {
function print_colour {
local colour="$1" contrast
contrast=$(contrast_colour "$1")
printf "\\e[48;5;%sm" "$colour" # Start block of colour
printf "\\e[38;5;%sm%3d" "$contrast" "$colour" # In contrast, print number
printf "\\e[0m " # Reset colour
printf "\\e[38;5;%s;48;5;%sm%3d\\e[0m " "$contrast" "$colour" "$colour"
}

# Starting at $1, print a run of $2 colours

Loading…
Cancel
Save