Repository navigation
Expand file tree
/
Copy pathpinecone.config.js
More file actions
105 lines (93 loc) · 2.6 KB
/
Copy pathpinecone.config.js
File metadata and controls
105 lines (93 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import { colorish, defineConfig } from 'pinecone-cli'
import { roles } from '@rose-pine/palette'
const blend = (foreground, background, alpha) => {
const channels = (hex) =>
hex
.replace('#', '')
.match(/.{2}/g)
.map((channel) => Number.parseInt(channel, 16))
const foregroundChannels = channels(foreground)
const backgroundChannels = channels(background)
return `#${foregroundChannels
.map((channel, index) =>
Math.round(channel * alpha + backgroundChannels[index] * (1 - alpha))
.toString(16)
.padStart(2, '0')
)
.join('')}`
}
const palette = {}
Object.keys(roles).map((role) => {
const currentRole = roles[role]
// Add Rosé Pine palette.
palette[role] = {
main: currentRole.main.alpha?.hex ?? currentRole.main.hex,
moon: currentRole.moon.alpha?.hex ?? currentRole.moon.hex,
dawn: currentRole.dawn.alpha?.hex ?? currentRole.dawn.hex,
}
// Add translucent variations.
palette[`${role}/80`] = {
main: colorish(currentRole.main.hex, 0.8),
moon: colorish(currentRole.moon.hex, 0.8),
dawn: colorish(currentRole.dawn.hex, 0.8),
}
palette[`${role}/50`] = {
main: colorish(currentRole.main.hex, 0.5),
moon: colorish(currentRole.moon.hex, 0.5),
dawn: colorish(currentRole.dawn.hex, 0.5),
}
palette[`${role}/30`] = {
main: colorish(currentRole.main.hex, 0.3),
moon: colorish(currentRole.moon.hex, 0.3),
dawn: colorish(currentRole.dawn.hex, 0.3),
}
palette[`${role}/20`] = {
main: colorish(currentRole.main.hex, 0.2),
moon: colorish(currentRole.moon.hex, 0.2),
dawn: colorish(currentRole.dawn.hex, 0.2),
}
palette[`${role}/15`] = {
main: colorish(currentRole.main.hex, 0.15),
moon: colorish(currentRole.moon.hex, 0.15),
dawn: colorish(currentRole.dawn.hex, 0.15),
}
})
const inputBackground = {
main: blend(roles.overlay.main.hex, roles.surface.main.hex, 0.5),
moon: blend(roles.overlay.moon.hex, roles.surface.moon.hex, 0.5),
dawn: blend(roles.overlay.dawn.hex, roles.surface.dawn.hex, 0.5),
}
export default defineConfig({
options: {
source: './themes/_pinecone-color-theme.json',
output: './themes',
prefix: '$',
includeNonItalicVariants: true,
},
variants: {
main: {
name: 'Rosé Pine',
type: 'dark',
},
moon: {
name: 'Rosé Pine Moon',
type: 'dark',
},
dawn: {
name: 'Rosé Pine Dawn',
type: 'light',
},
},
colors: {
shadow: colorish(palette.surface, 0.3),
transparent: '#0000',
onPrimary: palette.base,
primary: palette.rose,
primaryHover: colorish(palette.rose, 0.9),
onSecondary: palette.base,
secondary: palette.iris,
secondaryHover: colorish(palette.iris, 0.9),
inputBackground,
...palette,
},
})