From 39fe5217c6346297def6d811889fcde5c1e3fc30 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Wed, 8 Aug 2018 01:00:43 +0200 Subject: Pad colors with zeroes --- functions/colors.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'functions') diff --git a/functions/colors.zsh b/functions/colors.zsh index 758b3446..71ca7c9a 100755 --- a/functions/colors.zsh +++ b/functions/colors.zsh @@ -314,7 +314,8 @@ function foregroundColor() { function getColorCode() { # Early exit: Check if given value is already numerical if [[ "$1" = <-> ]]; then - echo -n "$1" + # Pad color with zeroes + echo -n "${(l:3::0:)1}" return fi -- cgit v1.2.3