From 66d14d6542784bc7e63db78a1b04a7c609a5e4d8 Mon Sep 17 00:00:00 2001 From: Victor Alvarenga Date: Mon, 24 Oct 2022 15:22:15 -0300 Subject: [PATCH 1/2] perf(tint): improve tint performance reduce the amount of if checks for default color --- src/color/tint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/color/tint.js b/src/color/tint.js index e4bd9417..a422af79 100644 --- a/src/color/tint.js +++ b/src/color/tint.js @@ -27,7 +27,7 @@ import mix from './mix' function tint(percentage: number | string, color: string): string { if (color === 'transparent') return color - return mix(parseFloat(percentage), 'rgb(255, 255, 255)', color) + return mix(parseFloat(percentage), '#FFFFFF', color) } // prettier-ignore From ac7dcc1401925c7bcd1540308db64565257d5f26 Mon Sep 17 00:00:00 2001 From: Victor Alvarenga Date: Mon, 24 Oct 2022 15:22:34 -0300 Subject: [PATCH 2/2] perf(shade): improve shade performance reduce the amount of if checks for default color --- src/color/shade.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/color/shade.js b/src/color/shade.js index 7a50efe5..04fcbe05 100644 --- a/src/color/shade.js +++ b/src/color/shade.js @@ -27,7 +27,7 @@ import mix from './mix' function shade(percentage: number | string, color: string): string { if (color === 'transparent') return color - return mix(parseFloat(percentage), 'rgb(0, 0, 0)', color) + return mix(parseFloat(percentage), '#000000', color) } // prettier-ignore