mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-12-03 14:53:41 +08:00
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
|