From 161e29b36e6d3864561ea08aa5ee4a30208875e8 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 11 Jul 2022 16:58:22 +0530 Subject: [PATCH] Use existing code --- src/platform/web/ThemeBuilder.ts | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/platform/web/ThemeBuilder.ts b/src/platform/web/ThemeBuilder.ts index a192424c..b8e7274b 100644 --- a/src/platform/web/ThemeBuilder.ts +++ b/src/platform/web/ThemeBuilder.ts @@ -15,30 +15,7 @@ limitations under the License. */ import type {ThemeInformation} from "./ThemeLoader"; import {ColorSchemePreference} from "./ThemeLoader"; -import {offColor} from 'off-color'; - -function derive(value, operation, argument, isDark) { - const argumentAsNumber = parseInt(argument); - if (isDark) { - // For dark themes, invert the operation - if (operation === 'darker') { - operation = "lighter"; - } - else if (operation === 'lighter') { - operation = "darker"; - } - } - switch (operation) { - case "darker": { - const newColorString = offColor(value).darken(argumentAsNumber / 100).hex(); - return newColorString; - } - case "lighter": { - const newColorString = offColor(value).lighten(argumentAsNumber / 100).hex(); - return newColorString; - } - } -} +import {derive} from "../../../scripts/postcss/color.mjs"; export class ThemeBuilder { // todo: replace any with manifest type when PR is merged