@therms/web-js
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -0,1 +1,8 @@ | ||
## [1.6.1](http://bitbucket.org/thermsio/web-js/compare/v1.6.0...v1.6.1) (2022-01-28) | ||
### Bug Fixes | ||
* getColorContrast() check for no value ([a0c63cf](http://bitbucket.org/thermsio/web-js/commits/a0c63cf2bfdcb58c2ac0f431b1f25b591cf03d22)) | ||
# [1.6.0](http://bitbucket.org/thermsio/web-js/compare/v1.5.0...v1.6.0) (2022-01-16) | ||
@@ -2,0 +9,0 @@ |
@@ -285,7 +285,12 @@ 'use strict'; | ||
return calculatedMap[hex]; | ||
if (!hex || typeof hex !== 'string') | ||
return darkColor; | ||
let _hex = hex[0] === '#' ? hex.slice(1) : hex; | ||
if (hex.length < 6) { | ||
_hex = _hex.split('').map((value) => { | ||
_hex = _hex | ||
.split('') | ||
.map((value) => { | ||
return value + value; | ||
}).join(''); | ||
}) | ||
.join(''); | ||
} | ||
@@ -292,0 +297,0 @@ const r = parseInt(_hex.substring(0, 2), 16); |
@@ -15,7 +15,12 @@ const calculatedMap = {}; | ||
return calculatedMap[hex]; | ||
if (!hex || typeof hex !== 'string') | ||
return darkColor; | ||
let _hex = hex[0] === '#' ? hex.slice(1) : hex; | ||
if (hex.length < 6) { | ||
_hex = _hex.split('').map((value) => { | ||
_hex = _hex | ||
.split('') | ||
.map((value) => { | ||
return value + value; | ||
}).join(''); | ||
}) | ||
.join(''); | ||
} | ||
@@ -22,0 +27,0 @@ const r = parseInt(_hex.substring(0, 2), 16); |
{ | ||
"name": "@therms/web-js", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Common web/JS tools & utilities", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
74395
1177