From 158d3ce761eacac4a61cea254b2a1ad18b1a0e42 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Tue, 29 Dec 2020 02:10:04 -0700 Subject: [PATCH] remove no longer needed utility functions [skip ci] --- hyperglass/ui/util/theme.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/hyperglass/ui/util/theme.js b/hyperglass/ui/util/theme.js index cb6ae8e..ab777a2 100644 --- a/hyperglass/ui/util/theme.js +++ b/hyperglass/ui/util/theme.js @@ -120,30 +120,9 @@ export const makeTheme = userTheme => ({ ...chakraTheme, colors: importColors(userTheme.colors), fonts: importFonts(userTheme.fonts), + global: () => ({ body: { overflow: 'hidden' } }), }); -export const isDark = color => { - // YIQ equation from http://24ways.org/2010/calculating-color-contrast - const rgb = chroma(color).rgb(); - const yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000; - return yiq < 128; -}; - -export const isLight = color => isDark(color); - -export const opposingColor = (theme, color) => { - if (color.match(/^\w+\.\d+$/m)) { - const colorParts = color.split('.'); - if (colorParts.length !== 2) { - throw Error(`Color is improperly formatted. Got '${color}'`); - } - const [colorName, colorOpacity] = colorParts; - color = theme.colors[colorName][colorOpacity]; - } - const opposing = isDark(color) ? theme.colors.white : theme.colors.black; - return opposing; -}; - export const googleFontUrl = (fontFamily, weights = [300, 400, 700]) => { const urlWeights = weights.join(','); const fontName = fontFamily.split(/, /)[0].trim().replace(/'|"/g, '');