Refactor scripts

This commit is contained in:
2019-11-18 11:04:13 +09:00
parent 7e25ee6faf
commit 1ddcd4d570
33 changed files with 670 additions and 749 deletions

View File

@ -1,4 +1,4 @@
export function hexToHSL(hex: string) {
export default function hexToHSL(hex: string) {
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex)
if(!result) {
@ -20,7 +20,7 @@ export function hexToHSL(hex: string) {
let s = 0
const l = (max + min) / 2
if(max == min) {
if(max === min) {
h = s = 0
} else {
const d = max - min