Run Prettier, configure ESLint.

This commit is contained in:
Mikael Sand
2018-03-19 04:07:47 +02:00
parent 4e6ba9a786
commit 28235ea137
21 changed files with 422 additions and 253 deletions
+9 -6
View File
@@ -1,8 +1,8 @@
import Color from 'color';
import patternReg from './patternReg';
import Color from "color";
import patternReg from "./patternReg";
export default function (colorOrBrush) {
if (colorOrBrush === 'none' || !colorOrBrush) {
export default function(colorOrBrush) {
if (colorOrBrush === "none" || !colorOrBrush) {
return null;
}
@@ -12,8 +12,11 @@ export default function (colorOrBrush) {
if (matched) {
return [1, matched[1]];
//todo:
} else { // solid color
let [r, g, b, a = 1] = Color(colorOrBrush).rgb().array();
} else {
// solid color
let [r, g, b, a = 1] = Color(colorOrBrush)
.rgb()
.array();
return [0, r / 255, g / 255, b / 255, a];
}
} catch (err) {