scoop:scoop.ui.style.shadcn:0.1.0
src/palette.scoop
Selected production source · src/palette.scoop
1
package scoop.ui.style.shadcn3
import scoop.graphics.Color4
import scoop.ui.style.*6
// Neutral tokens from https://ui.shadcn.com/docs/theming (2026-11-04).7
// OKLCH -> OKLab -> linear sRGB -> sRGB, clipped to the Color gamut.8
// Destructive foreground and disabled/shadow are local paired drawing values.10
internal fun lightPalette(): ThemePalette {11
val background = Color(1.000000000, 1.000000000, 1.000000000) // background: oklch(1 0 0)12
val foreground = Color(0.039388235, 0.039388235, 0.039388235) // foreground: oklch(0.145 0 0)13
val card = Color(1.000000000, 1.000000000, 1.000000000) // card: oklch(1 0 0)14
val cardForeground =15
Color(0.039388235, 0.039388235, 0.039388235) // card-foreground: oklch(0.145 0 0)16
val popover = Color(1.000000000, 1.000000000, 1.000000000) // popover: oklch(1 0 0)17
val popoverForeground =18
Color(0.039388235, 0.039388235, 0.039388235) // popover-foreground: oklch(0.145 0 0)19
val primary = Color(0.090527405, 0.090527405, 0.090527405) // primary: oklch(0.205 0 0)20
val primaryForeground =21
Color(0.980255980, 0.980255980, 0.980255980) // primary-foreground: oklch(0.985 0 0)22
val secondary = Color(0.960586987, 0.960586987, 0.960586987) // secondary: oklch(0.97 0 0)23
val secondaryForeground =24
Color(0.090527405, 0.090527405, 0.090527405) // secondary-foreground: oklch(0.205 0 0)25
val muted = Color(0.960586987, 0.960586987, 0.960586987) // muted: oklch(0.97 0 0)26
val mutedForeground =27
Color(0.451519243, 0.451519243, 0.451519243) // muted-foreground: oklch(0.556 0 0)28
val accent = Color(0.960586987, 0.960586987, 0.960586987) // accent: oklch(0.97 0 0)29
val accentForeground =30
Color(0.090527405, 0.090527405, 0.090527405) // accent-foreground: oklch(0.205 0 0)31
val destructive =32
Color(0.906457563, 0.000000000, 0.042214553) // destructive: oklch(0.577 0.245 27.325)33
val destructiveForeground =34
Color(0.980255980, 0.980255980, 0.980255980) // destructive-foreground: oklch(0.985 0 0)35
val border = Color(0.898160664, 0.898160664, 0.898160664) // border: oklch(0.922 0 0)36
val input = Color(0.898160664, 0.898160664, 0.898160664) // input: oklch(0.922 0 0)37
val ring = Color(0.630163204, 0.630163204, 0.630163204) // ring: oklch(0.708 0 0)38
val chart1 = Color(0.960705487, 0.288190739, 0.000000000) // chart-1: oklch(0.646 0.222 41.116)39
val chart2 = Color(0.000000000, 0.589268239, 0.537288460) // chart-2: oklch(0.6 0.118 184.704)40
val chart3 = Color(0.063728275, 0.306708583, 0.393741649) // chart-3: oklch(0.398 0.07 227.392)41
val chart4 = Color(1.000000000, 0.727255714, 0.000000000) // chart-4: oklch(0.828 0.189 84.429)42
val chart5 = Color(0.994271450, 0.602092724, 0.000000000) // chart-5: oklch(0.769 0.188 70.08)43
val sidebar = Color(0.980255980, 0.980255980, 0.980255980) // sidebar: oklch(0.985 0 0)44
val sidebarForeground =45
Color(0.039388235, 0.039388235, 0.039388235) // sidebar-foreground: oklch(0.145 0 0)46
val sidebarPrimary =47
Color(0.090527405, 0.090527405, 0.090527405) // sidebar-primary: oklch(0.205 0 0)48
val sidebarPrimaryForeground =49
Color(0.980255980, 0.980255980, 0.980255980) // sidebar-primary-foreground: oklch(0.985 0 0)50
val sidebarAccent =51
Color(0.960586987, 0.960586987, 0.960586987) // sidebar-accent: oklch(0.97 0 0)52
val sidebarAccentForeground =53
Color(0.090527405, 0.090527405, 0.090527405) // sidebar-accent-foreground: oklch(0.205 0 0)54
val sidebarBorder =55
Color(0.898160664, 0.898160664, 0.898160664) // sidebar-border: oklch(0.922 0 0)56
val sidebarRing = Color(0.630163204, 0.630163204, 0.630163204) // sidebar-ring: oklch(0.708 0 0)57
return ThemePalette(58
background = ColorPair(background, foreground),59
card = ColorPair(card, cardForeground),60
popover = ColorPair(popover, popoverForeground),61
primary = ColorPair(primary, primaryForeground),62
secondary = ColorPair(secondary, secondaryForeground),63
muted = ColorPair(muted, mutedForeground),64
accent = ColorPair(accent, accentForeground),65
destructive = ColorPair(destructive, destructiveForeground),66
border = border,67
input = input,68
ring = ring,69
chart = ChartPalette(chart1, chart2, chart3, chart4, chart5),70
sidebar =71
SidebarPalette(72
ColorPair(sidebar, sidebarForeground),73
ColorPair(sidebarPrimary, sidebarPrimaryForeground),74
ColorPair(sidebarAccent, sidebarAccentForeground),75
sidebarBorder,76
sidebarRing77
),78
disabledText = foreground.withAlpha(0.5),79
shadow = Color.Black.withAlpha(0.10)80
)81
}83
internal fun darkPalette(): ThemePalette {84
val background = Color(0.039388235, 0.039388235, 0.039388235) // background: oklch(0.145 0 0)85
val foreground = Color(0.980255980, 0.980255980, 0.980255980) // foreground: oklch(0.985 0 0)86
val card = Color(0.090527405, 0.090527405, 0.090527405) // card: oklch(0.205 0 0)87
val cardForeground =88
Color(0.980255980, 0.980255980, 0.980255980) // card-foreground: oklch(0.985 0 0)89
val popover = Color(0.090527405, 0.090527405, 0.090527405) // popover: oklch(0.205 0 0)90
val popoverForeground =91
Color(0.980255980, 0.980255980, 0.980255980) // popover-foreground: oklch(0.985 0 0)92
val primary = Color(0.898160664, 0.898160664, 0.898160664) // primary: oklch(0.922 0 0)93
val primaryForeground =94
Color(0.090527405, 0.090527405, 0.090527405) // primary-foreground: oklch(0.205 0 0)95
val secondary = Color(0.149382078, 0.149382078, 0.149382078) // secondary: oklch(0.269 0 0)96
val secondaryForeground =97
Color(0.980255980, 0.980255980, 0.980255980) // secondary-foreground: oklch(0.985 0 0)98
val muted = Color(0.149382078, 0.149382078, 0.149382078) // muted: oklch(0.269 0 0)99
val mutedForeground =100
Color(0.630163204, 0.630163204, 0.630163204) // muted-foreground: oklch(0.708 0 0)101
val accent = Color(0.149382078, 0.149382078, 0.149382078) // accent: oklch(0.269 0 0)102
val accentForeground =103
Color(0.980255980, 0.980255980, 0.980255980) // accent-foreground: oklch(0.985 0 0)104
val destructive =105
Color(1.000000000, 0.391152717, 0.403856795) // destructive: oklch(0.704 0.191 22.216)106
val destructiveForeground =107
Color(0.090527405, 0.090527405, 0.090527405) // destructive-foreground: oklch(0.205 0 0)108
val border =109
Color(1.000000000, 1.000000000, 1.000000000, 0.100000000) // border: oklch(1 0 0 / 0.1)110
val input =111
Color(1.000000000, 1.000000000, 1.000000000, 0.150000000) // input: oklch(1 0 0 / 0.15)112
val ring = Color(0.451519243, 0.451519243, 0.451519243) // ring: oklch(0.556 0 0)113
val chart1 = Color(0.077907783, 0.279135173, 0.901774418) // chart-1: oklch(0.488 0.243 264.376)114
val chart2 = Color(0.000000000, 0.738789145, 0.489280849) // chart-2: oklch(0.696 0.17 162.48)115
val chart3 = Color(0.994271450, 0.602092724, 0.000000000) // chart-3: oklch(0.769 0.188 70.08)116
val chart4 = Color(0.677909634, 0.275941959, 1.000000000) // chart-4: oklch(0.627 0.265 303.9)117
val chart5 = Color(1.000000000, 0.124615208, 0.339003260) // chart-5: oklch(0.645 0.246 16.439)118
val sidebar = Color(0.090527405, 0.090527405, 0.090527405) // sidebar: oklch(0.205 0 0)119
val sidebarForeground =120
Color(0.980255980, 0.980255980, 0.980255980) // sidebar-foreground: oklch(0.985 0 0)121
val sidebarPrimary =122
Color(0.077907783, 0.279135173, 0.901774418) // sidebar-primary: oklch(0.488 0.243 264.376)123
val sidebarPrimaryForeground =124
Color(0.980255980, 0.980255980, 0.980255980) // sidebar-primary-foreground: oklch(0.985 0 0)125
val sidebarAccent =126
Color(0.149382078, 0.149382078, 0.149382078) // sidebar-accent: oklch(0.269 0 0)127
val sidebarAccentForeground =128
Color(0.980255980, 0.980255980, 0.980255980) // sidebar-accent-foreground: oklch(0.985 0 0)129
val sidebarBorder =130
Color(131
1.000000000,132
1.000000000,133
1.000000000,134
0.100000000135
) // sidebar-border: oklch(1 0 0 / 0.1)136
val sidebarRing = Color(0.451519243, 0.451519243, 0.451519243) // sidebar-ring: oklch(0.556 0 0)137
return ThemePalette(138
background = ColorPair(background, foreground),139
card = ColorPair(card, cardForeground),140
popover = ColorPair(popover, popoverForeground),141
primary = ColorPair(primary, primaryForeground),142
secondary = ColorPair(secondary, secondaryForeground),143
muted = ColorPair(muted, mutedForeground),144
accent = ColorPair(accent, accentForeground),145
destructive = ColorPair(destructive, destructiveForeground),146
border = border,147
input = input,148
ring = ring,149
chart = ChartPalette(chart1, chart2, chart3, chart4, chart5),150
sidebar =151
SidebarPalette(152
ColorPair(sidebar, sidebarForeground),153
ColorPair(sidebarPrimary, sidebarPrimaryForeground),154
ColorPair(sidebarAccent, sidebarAccentForeground),155
sidebarBorder,156
sidebarRing157
),158
disabledText = foreground.withAlpha(0.5),159
shadow = Color.Black.withAlpha(0.30)160
)161
}