MCPcopy Create free account
hub / github.com/anus-dev/ANUS / constructor

Method constructor

packages/cli/src/ui/themes/theme.ts:151–165  ·  view source on GitHub ↗

* Creates a new Theme instance. * @param name The name of the theme. * @param rawMappings The raw CSSProperties mappings from a react-syntax-highlighter theme object.

(
    readonly name: string,
    readonly type: ThemeType,
    rawMappings: Record<string, CSSProperties>,
    readonly colors: ColorsTheme,
    readonly semanticColors: SemanticColors,
  )

Source from the content-addressed store, hash-verified

149 * @param rawMappings The raw CSSProperties mappings from a react-syntax-highlighter theme object.
150 */
151 constructor(
152 readonly name: string,
153 readonly type: ThemeType,
154 rawMappings: Record<string, CSSProperties>,
155 readonly colors: ColorsTheme,
156 readonly semanticColors: SemanticColors,
157 ) {
158 this._colorMap = Object.freeze(this._buildColorMap(rawMappings)); // Build and freeze the map
159
160 // Determine the default foreground color
161 const rawDefaultColor = rawMappings['hljs']?.color;
162 this.defaultColor =
163 (rawDefaultColor ? Theme._resolveColor(rawDefaultColor) : undefined) ??
164 ''; // Default to empty string if not found or resolvable
165 }
166
167 /**
168 * Gets the Ink-compatible color string for a given highlight.js class name.

Callers

nothing calls this directly

Calls 2

_buildColorMapMethod · 0.95
_resolveColorMethod · 0.80

Tested by

no test coverage detected