summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVon Random <von@vdrandom.org>2018-06-18 15:24:49 +0300
committerVon Random <von@vdrandom.org>2018-06-18 15:24:49 +0300
commitb794ce3b0b16559e461a6fa0a929880534b5ac85 (patch)
treee4cabdc7d63e9aca410188658e4236faceba61be
parent63c9908af238a5786ba2fdd9d1ee74efe9711453 (diff)
fix some shell scripting, remove st from this repo (just compile it locally, mkay?)
-rwxr-xr-xprint256colours.sh13
-rwxr-xr-xstbin97640 -> 0 bytes
2 files changed, 6 insertions, 7 deletions
diff --git a/print256colours.sh b/print256colours.sh
index 99e3d8c..a16db0b 100755
--- a/print256colours.sh
+++ b/print256colours.sh
@@ -11,7 +11,6 @@ printable_colours=256
# Return a colour that contrasts with the given colour
# Bash only does integer division, so keep it integral
function contrast_colour {
- local r g b luminance
colour="$1"
if (( colour < 16 )); then # Initial 16 ANSI colours
@@ -52,9 +51,9 @@ 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[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
}
# Starting at $1, print a run of $2 colours
@@ -77,7 +76,7 @@ function print_blocks {
# Print sets of blocks
for (( i = start; i <= end; i += (blocks_per_line-1) * block_length )) do
- printf "\n" # Space before each set of blocks
+ printf "\\n" # Space before each set of blocks
# For each block row
for (( row = 0; row < block_rows; row++ )) do
# Print block columns for all blocks on the line
@@ -85,12 +84,12 @@ function print_blocks {
print_run $(( i + (block * block_length) )) "$block_cols"
done
(( i += block_cols )) # Prepare to print the next row
- printf "\n"
+ printf "\\n"
done
done
}
print_run 0 16 # The first 16 colours are spread over the whole spectrum
-printf "\n"
+printf "\\n"
print_blocks 16 231 6 6 3 # 6x6x6 colour cube between 16 and 231 inclusive
print_blocks 232 255 12 2 1 # Not 50, but 24 Shades of Grey
diff --git a/st b/st
deleted file mode 100755
index 01d577b..0000000
--- a/st
+++ /dev/null
Binary files differ