From 7f22c025ab0a34d2c0ce249e6d0aac1a1c9d6485 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 6 Oct 2024 20:41:05 +0200 Subject: [PATCH] fix todo --- .config/fish/functions/latex-color.fish | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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