diff --git a/.config/fish/functions/latex-color.fish b/.config/fish/functions/latex-color.fish index c8aca07..c942822 100644 --- a/.config/fish/functions/latex-color.fish +++ b/.config/fish/functions/latex-color.fish @@ -19,10 +19,12 @@ function latex-color --description "Get the LaTeX color from HEX code" end # Expand 3 hex to 4 hex - # TODO - - # Expand 3 hex to 8 hex if test (string length $hex) -eq 3 + set hex $(string join "" $hex 0) + end + + # Expand 4 hex to 8 hex + if test (string length $hex) -eq 4 set hex "$(string replace -ar '(.)' '$1$1' $hex)00" end