2022-09-25 04:32:49 +00:00
|
|
|
export const lightColors = [
|
2022-11-01 23:36:48 +00:00
|
|
|
'#B3E5FC',
|
|
|
|
'#FA8072',
|
|
|
|
'#FFC0CB',
|
|
|
|
'#E9DCC9',
|
|
|
|
'#BBA1CE',
|
2022-10-31 04:22:08 +00:00
|
|
|
]
|
2022-09-25 04:32:49 +00:00
|
|
|
|
2022-11-01 23:36:48 +00:00
|
|
|
export const darkColors = ['#8156A7', '#007AFF', '#000000', '#CD5C5C']
|
2022-10-04 01:35:56 +00:00
|
|
|
|
|
|
|
export const colorShade = (color: any, amount: number) => {
|
2022-10-31 04:22:08 +00:00
|
|
|
color = color.replace(/^#/, '')
|
2022-10-04 01:35:56 +00:00
|
|
|
if (color.length === 3)
|
2022-10-31 04:22:08 +00:00
|
|
|
color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2]
|
2022-10-04 01:35:56 +00:00
|
|
|
|
2022-10-31 04:22:08 +00:00
|
|
|
let [r, g, b] = color.match(/.{2}/g)
|
|
|
|
;[r, g, b] = [
|
2022-10-04 01:35:56 +00:00
|
|
|
parseInt(r, 16) + amount,
|
|
|
|
parseInt(g, 16) + amount,
|
|
|
|
parseInt(b, 16) + amount,
|
2022-10-31 04:22:08 +00:00
|
|
|
]
|
2022-10-04 01:35:56 +00:00
|
|
|
|
2022-10-31 04:22:08 +00:00
|
|
|
r = Math.max(Math.min(255, r), 0).toString(16)
|
|
|
|
g = Math.max(Math.min(255, g), 0).toString(16)
|
|
|
|
b = Math.max(Math.min(255, b), 0).toString(16)
|
2022-10-04 01:35:56 +00:00
|
|
|
|
2022-10-31 04:22:08 +00:00
|
|
|
const rr = (r.length < 2 ? '0' : '') + r
|
|
|
|
const gg = (g.length < 2 ? '0' : '') + g
|
|
|
|
const bb = (b.length < 2 ? '0' : '') + b
|
2022-10-04 01:35:56 +00:00
|
|
|
|
2022-10-31 04:22:08 +00:00
|
|
|
return `#${rr}${gg}${bb}`
|
|
|
|
}
|