Fix some eslint errors

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2019-02-14 13:58:15 +01:00
parent b46e4c918a
commit bd0aa664b8
8 changed files with 26 additions and 15 deletions

View File

@@ -24,12 +24,14 @@ export default {
methods: {
hexToRgb(hex) {
let result = /^#?([A-Fa-f\d]{2})([A-Fa-f\d]{2})([A-Fa-f\d]{2})$/i.exec(hex)
return result
? {
if (result) {
return {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null
}
}
return null
},
rgb2hls(rgb) {
// RGB2HLS by Garry Tan