style: Unified spacing to 2 and add editor config

This commit is contained in:
Wessel Tip
2021-03-17 14:01:53 +01:00
parent aec47d9d0b
commit 9981a28638
98 changed files with 2931 additions and 2902 deletions

View File

@@ -1,19 +1,19 @@
const isValidRGBValue = (value) => {
return (typeof (value) === 'number' && Number.isNaN(value) === false && value >= 0 && value <= 255);
return (typeof (value) === 'number' && Number.isNaN(value) === false && value >= 0 && value <= 255);
}
export default function setRGBA(red, green, blue, alpha) {
if (isValidRGBValue(red) && isValidRGBValue(green) && isValidRGBValue(blue)) {
const color = {
red: red | 0,
green: green | 0,
blue: blue | 0,
};
if (isValidRGBValue(red) && isValidRGBValue(green) && isValidRGBValue(blue)) {
const color = {
red: red | 0,
green: green | 0,
blue: blue | 0,
};
if (isValidRGBValue(alpha) === true) {
color.alpha = alpha | 0;
}
return color;
if (isValidRGBValue(alpha) === true) {
color.alpha = alpha | 0;
}
return color;
}
}