From b04a9d1229e1ed35f61634ae25519cfbcb8a2c29 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 5 Aug 2018 05:41:37 +0300 Subject: cleanup, fixed self-highlighting in notifications, fixed incorrect hex code handling --- src/services/user_highlighter/user_highlighter.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/services/user_highlighter/user_highlighter.js') diff --git a/src/services/user_highlighter/user_highlighter.js b/src/services/user_highlighter/user_highlighter.js index 31eba2c8..ebb25eca 100644 --- a/src/services/user_highlighter/user_highlighter.js +++ b/src/services/user_highlighter/user_highlighter.js @@ -1,12 +1,10 @@ import { hex2rgb } from '../color_convert/color_convert.js' const highlightStyle = (prefs) => { - if (prefs === undefined) { - return - } + if (prefs === undefined) return const {color, type} = prefs - console.log(arguments) if (typeof color !== 'string') return const rgb = hex2rgb(color) + if (rgb == null) return const solidColor = `rgb(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)})` const tintColor = `rgba(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)}, .1)` const tintColor2 = `rgba(${Math.floor(rgb.r)}, ${Math.floor(rgb.g)}, ${Math.floor(rgb.b)}, .2)` -- cgit v1.2.3-70-g09d2