mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-07 15:20:22 +00:00
2542929eb9
+ msg.util.get.color.fish + msg.util.random.color.fish + msg.util.set.color.fish + msg.util.str.get.fish + msg.util.str.has.fish
22 lines
416 B
Fish
22 lines
416 B
Fish
# Set style, fg/bg colors and reset. Modifies its parent scope of `msg`.
|
|
# @params [<fg>] [<bg>] [<style>]
|
|
function --no-scope-shadowing msg.util.set.color
|
|
if [ (count $argv) -gt 0 ]
|
|
set fg $argv[1]
|
|
end
|
|
|
|
if [ (count $argv) -gt 1 ]
|
|
set bg $argv[2]
|
|
end
|
|
|
|
set_color -b $bg
|
|
set_color $fg
|
|
|
|
if [ (count $argv) -gt 2 ]
|
|
set_color $argv[3]
|
|
end
|
|
|
|
set bg $msg_color_bg
|
|
set fg $msg_color_fg
|
|
end
|