MCPcopy Index your code
hub / github.com/continuedev/continue / getBackgroundColor

Method getBackgroundColor

core/codeRenderer/CodeRenderer.ts:397–412  ·  view source on GitHub ↗
(shikiHtml: string)

Source from the content-addressed store, hash-verified

395 }
396
397 getBackgroundColor(shikiHtml: string): string {
398 const dom = new JSDOM(shikiHtml);
399 const document = dom.window.document;
400
401 const preElement = document.querySelector("pre");
402 let backgroundColor = "#333333"; // Default white background
403 if (preElement) {
404 const style = preElement.getAttribute("style") || "";
405 const bgColorMatch = style.match(/background-color:\s*(#[0-9a-fA-F]{6})/);
406 if (bgColorMatch) {
407 backgroundColor = bgColorMatch[1];
408 }
409 }
410
411 return backgroundColor;
412 }
413
414 async getDataUri(
415 code: string,

Callers 1

convertToSVGMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected