From bc549648b38698b7bd3cb71ab7e71bb17a3a68a1 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Thu, 12 Dec 2019 15:18:49 -0500 Subject: Fix color matcher for inbetween step values --- src/formats.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/formats.ts') diff --git a/src/formats.ts b/src/formats.ts index 86d3f6b..b64c418 100644 --- a/src/formats.ts +++ b/src/formats.ts @@ -33,8 +33,10 @@ export const defaultColorMatches = ( ? 15 : coverage >= style.stage2 ? Math.floor( - ((style.stage1 - coverage) / (style.stage1 - style.stage2)) * 240 - ) + 15 + ((style.stage1 - coverage) / (style.stage1 - style.stage2)) * 15 + ) * + 16 + + 15 : 240 + Math.floor(coverage / (style.stage2 / 15)); const result = gradient.toString(16); return (result.length === 1 ? "0" : "") + result + "0"; -- cgit