ide/scripts/24-bit-color.sh
Joao P Dubas d9a33dc515 feat: upgrade ubuntu to 23.10 (#30)
In addition to upgrading ubuntu to 23.10, the following changes were made:

1. Use the latest commit from [kickstart.nvim][0]
2. Setup [atuin][1] to share `shell` history
3. Conditionally configure `git`, based on [`gitbutler` blog post][2]
4. Improve `tmux` colorscheme configuration, based on [tmux vim truecolor git by andersevenrud][3]
5. Update cli's installed by `mise`:
   * awscli to 2.15.30
   * dagger to 0.10.2
   * elixir to 1.16.2
   * erlang to 26.2.3
   * eza to 0.18.7
   * fzf to 0.48.1
   * go to 1.22.1
   * helm to 3.14.3
   * kubectl to 1.29.3
   * lefthook to 1.6.7
   * node to 21.7.1
   * poetry to 1.8.2
   * python to 3.12.2
   * terraform to 1.7.5
   * tilt to 0.33.11
   * usql to 0.17.5
   * zoxide to 0.9.4
6. Added the cli's:
   * k3sup
   * k9s
   * rust

[0]: https://github.com/nvim-lua/kickstart.nvim
[1]: https://github.com/atuinsh/atuin
[2]: https://blog.gitbutler.com/git-tips-1-theres-a-git-config-for-that/#conditional-configs
[3]: https://gist.github.com/andersevenrud/015e61af2fd264371032763d4ed965b6

Reviewed-on: #30
Co-authored-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
Co-committed-by: Joao P Dubas <joao.dubas+gitea@gmail.com>
2024-03-28 00:18:20 +00:00

100 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# This file echoes a bunch of 24-bit color codes
# to the terminal to demonstrate its functionality.
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
setBackgroundColor()
{
echo -en "\x1b[48;2;$1;$2;$3""m"
}
resetOutput()
{
echo -en "\x1b[0m\n"
}
# Gives a color $1/255 % along HSV
# Who knows what happens when $1 is outside 0-255
# Echoes "$red $green $blue" where
# $red $green and $blue are integers
# ranging between 0 and 255 inclusive
rainbowColor()
{
let h=$1/43
let f=$1-43*$h
let t=$f*255/43
let q=255-t
if [ $h -eq 0 ]
then
echo "255 $t 0"
elif [ $h -eq 1 ]
then
echo "$q 255 0"
elif [ $h -eq 2 ]
then
echo "0 255 $t"
elif [ $h -eq 3 ]
then
echo "0 $q 255"
elif [ $h -eq 4 ]
then
echo "$t 0 255"
elif [ $h -eq 5 ]
then
echo "255 0 $q"
else
# execution should never reach here
echo "0 0 0"
fi
}
for i in `seq 0 127`; do
setBackgroundColor $i 0 0
echo -en " "
done
resetOutput
for i in `seq 255 128`; do
setBackgroundColor $i 0 0
echo -en " "
done
resetOutput
for i in `seq 0 127`; do
setBackgroundColor 0 $i 0
echo -n " "
done
resetOutput
for i in `seq 255 128`; do
setBackgroundColor 0 $i 0
echo -n " "
done
resetOutput
for i in `seq 0 127`; do
setBackgroundColor 0 0 $i
echo -n " "
done
resetOutput
for i in `seq 255 128`; do
setBackgroundColor 0 0 $i
echo -n " "
done
resetOutput
for i in `seq 0 127`; do
setBackgroundColor `rainbowColor $i`
echo -n " "
done
resetOutput
for i in `seq 255 128`; do
setBackgroundColor `rainbowColor $i`
echo -n " "
done
resetOutput