111 lines
3.5 KiB
Tcsh
111 lines
3.5 KiB
Tcsh
#######################
|
||
####### COLOURS #######
|
||
#######################
|
||
|
||
set csi='['
|
||
|
||
# Legacy 3-bit ANSI Forms:
|
||
set ansi_bright='1'
|
||
set ansi_dim='0'
|
||
set ansi_color='m'
|
||
set ansi_reverse='7'
|
||
|
||
set ansi_black='30'
|
||
set ansi_red='31'
|
||
set ansi_green='32'
|
||
set ansi_yellow='33'
|
||
set ansi_blue='34'
|
||
set ansi_magenta='35'
|
||
set ansi_cyan='36'
|
||
set ansi_white='37'
|
||
|
||
|
||
set bright="$csi$ansi_bright$ansi_color"
|
||
set dim="$csi$ansi_dim$ansi_color"
|
||
set reverse="$csi$ansi_reverse$ansi_color"
|
||
set blink="${csi}5${ansi_color}"
|
||
|
||
|
||
set black="$csi$ansi_black$ansi_color"
|
||
set red="$csi$ansi_red$ansi_color"
|
||
set green="$csi$ansi_green$ansi_color"
|
||
set yellow="$csi$ansi_yellow$ansi_color"
|
||
set blue="$csi$ansi_blue$ansi_color"
|
||
set magenta="$csi$ansi_magenta$ansi_color"
|
||
set cyan="$csi$ansi_cyan$ansi_color"
|
||
set white="$csi$ansi_white$ansi_color"
|
||
|
||
# Bright and Dim rely upon the console's setting of colour intensity paired
|
||
# to boldness intensity. For better colour choices, it's better to use
|
||
# extended colours or true colours.
|
||
|
||
|
||
|
||
set dim_black="$csi$ansi_dim;$ansi_black$ansi_color"
|
||
set dim_red="$csi$ansi_dim;$ansi_red$ansi_color"
|
||
set dim_green="$csi$ansi_dim;$ansi_green$ansi_color"
|
||
set dim_yellow="$csi$ansi_dim;$ansi_yellow$ansi_color"
|
||
set dim_blue="$csi$ansi_dim;$ansi_blue$ansi_color"
|
||
set dim_magenta="$csi$ansi_dim;$ansi_magenta$ansi_color"
|
||
set dim_cyan="$csi$ansi_dim;$ansi_cyan$ansi_color"
|
||
set dim_white="$csi$ansi_dim;$ansi_white$ansi_color"
|
||
|
||
|
||
set bright_black="$csi$ansi_bright;$ansi_black$ansi_color"
|
||
set bright_red="$csi$ansi_bright;$ansi_red$ansi_color"
|
||
set bright_green="$csi$ansi_bright;$ansi_green$ansi_color"
|
||
set bright_yellow="$csi$ansi_bright;$ansi_yellow$ansi_color"
|
||
set bright_blue="$csi$ansi_bright;$ansi_blue$ansi_color"
|
||
set bright_magenta="$csi$ansi_bright;$ansi_magenta$ansi_color"
|
||
set bright_cyan="$csi$ansi_bright;$ansi_cyan$ansi_color"
|
||
set bright_white="$csi$ansi_bright;$ansi_white$ansi_color"
|
||
|
||
# Also somewhat legacy are the extended colours... so I'm not implementing them.
|
||
# Instead, I'll use my script which does math on the 6 char hex string you use in
|
||
# colors...
|
||
|
||
#################################
|
||
# Extended 8-bit colour Support #
|
||
#################################
|
||
|
||
#######################
|
||
# True colour support #
|
||
#######################
|
||
|
||
# The idea behind a true colour variable is that you run: `__build_sgr_code ff0077` and it expands to
|
||
# a proper colour sequence for a 24-bit color. The shell script which computes these will also attempt to
|
||
# compute a rounded version of your color for use with 8-bit colour and a weaker rounded form for use
|
||
# with 3 and 4 bit colour. It does this based upon your terminal colour depth.
|
||
|
||
set sgr_reset="[`__build_sgr_code no-csi reset`m"
|
||
|
||
############################
|
||
# Terminal Palette setting #
|
||
############################
|
||
|
||
set ansi_0="000000"
|
||
set ansi_1="DD0000"
|
||
set ansi_2="00AA00"
|
||
set ansi_3="AA5500"
|
||
set ansi_4="2266DD"
|
||
set ansi_5="AA00AA"
|
||
set ansi_6="00AAAA"
|
||
set ansi_7="BBBBBB"
|
||
|
||
set ansi_8="484848"
|
||
set ansi_9="FF5555"
|
||
set ansi_10="55FF55"
|
||
set ansi_11="FFFF55"
|
||
set ansi_12="5577FF"
|
||
set ansi_13="FF55FF"
|
||
set ansi_14="55FFFF"
|
||
set ansi_15="FFFFFF"
|
||
|
||
alias set-terminal-colors echo "]4\;0\;#${ansi_0}\;1\;#${ansi_1}\;2\;#${ansi_2}\;3\;#${ansi_3}\;4\;#${ansi_4}\;5\;#${ansi_5}\;6\;#${ansi_6}\;7\;#${ansi_7}\;8\;#${ansi_8}\;9\;#${ansi_9}\;10\;#${ansi_10}\;11\;#${ansi_11}\;12\;#${ansi_12}\;13\;#${ansi_13}\;14\;#${ansi_14}\;15\;#${ansi_15}"
|
||
|
||
alias reset-terminal-colors echo "]104\;"
|
||
|
||
###########################
|
||
# vim:filetype=tcsh
|
||
###########################
|