Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create colorama.bash #100

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions lib/colorama.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/bin/bash


array=(
"""
</> kesalahan $1
argumen tidak terdaftar
syntax $1 eror
"""
)

: '
author : Bayu riski

mode :
bold
normal
stop

list color :
merah
hijau
kuning
biru
pink
cyan
putih
'

# report bug : +6285731184377
# email : [email protected]

function bold {

if (( $? == 0 )); then {
wait
}
else {
str=1
}
fi

case $1 in
hitam){
{ ( setterm --foreground black --bold off ) }
} ;;
merah){
{ ( setterm --foreground red --bold on ) }
} ;;
hijau){
{ ( setterm --foreground green --bold on ) }
} ;;
kuning){
{ ( setterm --foreground yellow --bold on ) }
}
;;
biru){
{ ( setterm --foreground blue --bold on ) }
} ;;
pink)(setterm --foreground magenta --bold on) ;;
cyan)(setterm --foreground cyan --bold on) ;;
putih)(setterm --foreground white --bold on) ;;
\<*): killall setterm ;;
*)echo "${array[*]}"; exit 4
;;
esac


}

function normal {

if (( $? == 0 )); then
str=${1}
else
str=1
fi

case $1 in
hitam)(setterm --foreground black --bold off) ;;
merah)(setterm --foreground red --bold off) ;;
hijau)(setterm --foreground green --bold off) ;;
kuning)(setterm --foreground yellow --bold off) ;;
biru)(setterm --foreground blue --bold off) ;;
pink)(setterm --foreground magenta --bold off) ;;
cyan)(setterm --foreground cyan --bold off) ;;
putih)(setterm --foreground white --bold off) ;;
*)echo "${array[*]}"; exit 4
;;
esac
}

function stop {
{
( setterm --foreground default )
}
return 0
wait
}

function blink {
# comming soon
shift
}