From 8f290f17cb0c24b4116b3ced69af11373c178f12 Mon Sep 17 00:00:00 2001 From: actionless Date: Sun, 1 Jan 2023 17:14:48 +0100 Subject: [PATCH] =?UTF-8?q?fix(scripts:=20darker):=20convert=20hex=20to=20?= =?UTF-8?q?int=20before=20math,=20lol=20it=20was=20broken=20for=20so=20man?= =?UTF-8?q?y=20years=20=F0=9F=98=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/darker.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/darker.sh b/scripts/darker.sh index b9514a4..fed6026 100755 --- a/scripts/darker.sh +++ b/scripts/darker.sh @@ -5,7 +5,8 @@ set -ueo pipefail darker_channel() { value="$1" light_delta="$2" - result="$(bc <<< "ibase=16; $value - $light_delta")" + value_int="$(bc <<< "ibase=16; $value")" + result="$(bc <<< "$value_int - $light_delta")" if [[ "$result" -lt 0 ]]; then result=0 fi