From c55cd827c7e76736ca7471927e0957d764b31df5 Mon Sep 17 00:00:00 2001 From: Cookie <52550063+Covkie@users.noreply.github.com> Date: Sat, 25 Jan 2025 16:38:50 -0500 Subject: [PATCH] fix(themes): properly convert signed ints to hex (#8) processColor returns signed ints representing the colour. without the `>>> 0`converting to unsigned while preserving 2s compliment the function could return insane values. ex: #ffffff -> #-1 --- src/utilities/withoutOpacity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/withoutOpacity.ts b/src/utilities/withoutOpacity.ts index 061a846..c2a729e 100644 --- a/src/utilities/withoutOpacity.ts +++ b/src/utilities/withoutOpacity.ts @@ -7,7 +7,7 @@ import { processColor, type ColorValue } from 'react-native'; * @returns The color provided as a hex string without opacity. */ function withoutOpacity(color: number | ColorValue): string { - const processed = processColor(color).toString(16); + const processed = (Number(processColor(color)) >>> 0).toString(16); return '#' + processed.slice(-6); }