Skip to content

workbench.shared

Shared helpers used by all workbench variant functions.

Centralises the three pieces of logic that are identical across all workbench token generators: cursor color resolution, diagnostic opacity mapping, and selection background color resolution.

const CURSOR_COLORS: Record<string, string>

Defined in: workbench/shared.ts:22

Maps cursor color setting values to their neutral or chromatic scale position.

"white" and "black" resolve to "975" — the most prominent neutral step, which is effectively white in dark mode and black in light mode. All chromatic options resolve to "500" — the full-weight chromatic step.


const OPACITY_MAP: Record<string, string>

Defined in: workbench/shared.ts:38

Maps the diagnosticTextBackgroundOpacity setting value to a two-digit hex alpha suffix suitable for appending to a 6-digit hex color.

resolveSelection(palette, prefix, color, greyOpacities): object

Defined in: workbench/shared.ts:64

Resolves the three selection background color variants used by the editor.

When color is "grey" or empty, the neutral 600 step is used with the provided opacity suffixes. For chromatic colors, the muted 300 step of the appropriate hue family is used at fixed opacities (60/40/20).

– The full palette object.

"#4a98a2" = "#4a98a2"

"#56b6c2" = "#56b6c2"

"#4d8fcc" = "#4d8fcc"

"#61aeee" = "#61aeee"

"#181a1e" = "#181a1e"

"#1d1e21" = "#1d1e21"

"#232428" = "#232428"

"#292b2f" = "#292b2f"

"#2f3135" = "#2f3135"

"#383b40" = "#383b40"

"#42464c" = "#42464c"

"#4e5258" = "#4e5258"

"#686c74" = "#686c74"

"#7c8088" = "#7c8088"

"#9a9ea6" = "#9a9ea6"

"#ced1d8" = "#ced1d8"

"#121316" = "#121316"

"#181a1e" = "#181a1e"

"#1d1e21" = "#1d1e21"

"#232428" = "#232428"

"#292b2f" = "#292b2f"

"#2f3135" = "#2f3135"

"#383b40" = "#383b40"

"#444850" = "#444850"

"#686c74" = "#686c74"

"#7c8088" = "#7c8088"

"#9a9ea6" = "#9a9ea6"

"#ced1d8" = "#ced1d8"

"#1d1e21" = "#1d1e21"

"#232428" = "#232428"

"#292b2f" = "#292b2f"

"#2f3135" = "#2f3135"

"#383b40" = "#383b40"

"#42464c" = "#42464c"

"#4c5058" = "#4c5058"

"#585d66" = "#585d66"

"#686c74" = "#686c74"

"#7c8088" = "#7c8088"

"#9a9ea6" = "#9a9ea6"

"#ced1d8" = "#ced1d8"

"#7a9f5a" = "#7a9f5a"

"#a3b87a" = "#a3b87a"

"#98c379" = "#98c379"

"#1a1918" = "#1a1918"

"#1f1e1c" = "#1f1e1c"

"#252422" = "#252422"

"#2b2a27" = "#2b2a27"

"#302f2c" = "#302f2c"

"#3a3936" = "#3a3936"

"#444240" = "#444240"

"#525050" = "#525050"

"#6b6862" = "#6b6862"

"#7e7b74" = "#7e7b74"

"#9c9890" = "#9c9890"

"#d3cfc6" = "#d3cfc6"

"#141413" = "#141413"

"#1a1918" = "#1a1918"

"#1f1e1c" = "#1f1e1c"

"#252422" = "#252422"

"#2b2a27" = "#2b2a27"

"#302f2c" = "#302f2c"

"#3a3936" = "#3a3936"

"#484644" = "#484644"

"#6b6862" = "#6b6862"

"#7e7b74" = "#7e7b74"

"#9c9890" = "#9c9890"

"#d3cfc6" = "#d3cfc6"

"#1f1e1c" = "#1f1e1c"

"#252422" = "#252422"

"#2b2a27" = "#2b2a27"

"#302f2c" = "#302f2c"

"#3a3936" = "#3a3936"

"#444240" = "#444240"

"#4e4c49" = "#4e4c49"

"#5c5a56" = "#5c5a56"

"#6b6862" = "#6b6862"

"#7e7b74" = "#7e7b74"

"#9c9890" = "#9c9890"

"#d3cfc6" = "#d3cfc6"

"#b86035" = "#b86035"

"#d97757" = "#d97757"

"#a05fb8" = "#a05fb8"

"#c678dd" = "#c678dd"

"#c45c65" = "#c45c65"

"#e06c75" = "#e06c75"

"#a84850" = "#a84850"

"#1d1b17" = "#1d1b17"

"#221f1b" = "#221f1b"

"#28251f" = "#28251f"

"#2e2b24" = "#2e2b24"

"#342f28" = "#342f28"

"#3e3930" = "#3e3930"

"#484238" = "#484238"

"#564e46" = "#564e46"

"#6e6558" = "#6e6558"

"#817870" = "#817870"

"#9e9488" = "#9e9488"

"#d6d0c4" = "#d6d0c4"

"#171410" = "#171410"

"#1d1b17" = "#1d1b17"

"#221f1b" = "#221f1b"

"#28251f" = "#28251f"

"#2e2b24" = "#2e2b24"

"#342f28" = "#342f28"

"#3e3930" = "#3e3930"

"#4c4540" = "#4c4540"

"#6e6558" = "#6e6558"

"#817870" = "#817870"

"#9e9488" = "#9e9488"

"#d6d0c4" = "#d6d0c4"

"#221f1b" = "#221f1b"

"#28251f" = "#28251f"

"#2e2b24" = "#2e2b24"

"#342f28" = "#342f28"

"#3e3930" = "#3e3930"

"#484238" = "#484238"

"#524b40" = "#524b40"

"#605850" = "#605850"

"#6e6558" = "#6e6558"

"#817870" = "#817870"

"#9e9488" = "#9e9488"

"#d6d0c4" = "#d6d0c4"

"#d19a66" = "#d19a66"

"#e6c07b" = "#e6c07b"

"#4a98a2" = "#4a98a2"

"#3a8a94" = "#3a8a94"

"#4d8fcc" = "#4d8fcc"

"#3a7fbb" = "#3a7fbb"

"#f0f1f5" = "#f0f1f5"

"#e8e9ed" = "#e8e9ed"

"#f8f9fc" = "#f8f9fc"

"#e8e9ed" = "#e8e9ed"

"#e0e2e7" = "#e0e2e7"

"#d8dadf" = "#d8dadf"

"#cdd0d6" = "#cdd0d6"

"#bbbec6" = "#bbbec6"

"#9a9ca4" = "#9a9ca4"

"#888b94" = "#888b94"

"#767880" = "#767880"

"#3b3c40" = "#3b3c40"

"#f8f9fc" = "#f8f9fc"

"#f0f1f5" = "#f0f1f5"

"#ffffff" = "#ffffff"

"#f0f1f5" = "#f0f1f5"

"#e8e9ed" = "#e8e9ed"

"#e0e2e7" = "#e0e2e7"

"#d8dadf" = "#d8dadf"

"#c6c8ce" = "#c6c8ce"

"#9a9ca4" = "#9a9ca4"

"#888b94" = "#888b94"

"#767880" = "#767880"

"#3b3c40" = "#3b3c40"

"#e8e9ed" = "#e8e9ed"

"#e0e2e7" = "#e0e2e7"

"#f0f1f5" = "#f0f1f5"

"#e0e2e7" = "#e0e2e7"

"#d8dadf" = "#d8dadf"

"#cdd0d6" = "#cdd0d6"

"#c2c5cc" = "#c2c5cc"

"#b0b4bc" = "#b0b4bc"

"#9a9ca4" = "#9a9ca4"

"#888b94" = "#888b94"

"#767880" = "#767880"

"#3b3c40" = "#3b3c40"

"#7a9f5a" = "#7a9f5a"

"#8daa52" = "#8daa52"

"#5a8a3a" = "#5a8a3a"

"#f3f1ea" = "#f3f1ea"

"#ebe9e1" = "#ebe9e1"

"#faf9f5" = "#faf9f5"

"#ebe9e1" = "#ebe9e1"

"#e3e1d8" = "#e3e1d8"

"#dad8cf" = "#dad8cf"

"#d0cec5" = "#d0cec5"

"#bab8b0" = "#bab8b0"

"#9c9890" = "#9c9890"

"#8a877f" = "#8a877f"

"#78766f" = "#78766f"

"#3d3c39" = "#3d3c39"

"#faf9f5" = "#faf9f5"

"#f3f1ea" = "#f3f1ea"

"#fffefb" = "#fffefb"

"#f3f1ea" = "#f3f1ea"

"#ebe9e1" = "#ebe9e1"

"#e3e1d8" = "#e3e1d8"

"#dad8cf" = "#dad8cf"

"#c4c2ba" = "#c4c2ba"

"#9c9890" = "#9c9890"

"#8a877f" = "#8a877f"

"#78766f" = "#78766f"

"#3d3c39" = "#3d3c39"

"#ebe9e1" = "#ebe9e1"

"#e3e1d8" = "#e3e1d8"

"#f3f1ea" = "#f3f1ea"

"#e3e1d8" = "#e3e1d8"

"#dad8cf" = "#dad8cf"

"#d0cec5" = "#d0cec5"

"#c6c4bb" = "#c6c4bb"

"#b4b2aa" = "#b4b2aa"

"#9c9890" = "#9c9890"

"#8a877f" = "#8a877f"

"#78766f" = "#78766f"

"#3d3c39" = "#3d3c39"

"#d97757" = "#d97757"

"#c96442" = "#c96442"

"#a05fb8" = "#a05fb8"

"#8a45aa" = "#8a45aa"

"#e06c75" = "#e06c75"

"#d44a55" = "#d44a55"

"#b03a44" = "#b03a44"

"#f5f0e6" = "#f5f0e6"

"#ede8dc" = "#ede8dc"

"#fdfaf2" = "#fdfaf2"

"#ede8dc" = "#ede8dc"

"#e5dfd2" = "#e5dfd2"

"#dcd5c8" = "#dcd5c8"

"#d2cabc" = "#d2cabc"

"#c0b8a8" = "#c0b8a8"

"#9e9888" = "#9e9888"

"#8c8678" = "#8c8678"

"#7a7468" = "#7a7468"

"#3e3b34" = "#3e3b34"

"#fdfaf2" = "#fdfaf2"

"#f5f0e6" = "#f5f0e6"

"#fffef8" = "#fffef8"

"#f5f0e6" = "#f5f0e6"

"#ede8dc" = "#ede8dc"

"#e5dfd2" = "#e5dfd2"

"#dcd5c8" = "#dcd5c8"

"#cac2b4" = "#cac2b4"

"#9e9888" = "#9e9888"

"#8c8678" = "#8c8678"

"#7a7468" = "#7a7468"

"#3e3b34" = "#3e3b34"

"#ede8dc" = "#ede8dc"

"#e5dfd2" = "#e5dfd2"

"#f5f0e6" = "#f5f0e6"

"#e5dfd2" = "#e5dfd2"

"#dcd5c8" = "#dcd5c8"

"#d2cabc" = "#d2cabc"

"#c8bfb0" = "#c8bfb0"

"#b6ac9c" = "#b6ac9c"

"#9e9888" = "#9e9888"

"#8c8678" = "#8c8678"

"#7a7468" = "#7a7468"

"#3e3b34" = "#3e3b34"

"#c49040" = "#c49040"

"#b07d2a" = "#b07d2a"

string

– The resolved variant + temperature + contrast prefix, e.g. "dark-neutral-balanced". The mode ("dark" or "light") is extracted as the first --delimited segment.

string

– The selection color setting value, e.g. "blue" or "grey".

[string, string, string]

– Tuple of three hex alpha suffixes applied to the grey neutral step for selectionBg, editorSelectionBg, and editorSelectionBgHl.

object

An object with the three resolved hex color strings.

editorSelectionBg: string

editorSelectionBgHl: string

selectionBg: string