MCPcopy
hub / github.com/xtermjs/xterm.js / getCellColor

Function getCellColor

test/playwright/SharedRendererTests.ts:1402–1412  ·  view source on GitHub ↗

* Gets the color of the pixel in the center of a cell. * @param ctx The test context. * @param col The 1-based column index to get the color for. * @param row The 1-based row index to get the color for.

(ctx: ITestContext, col: number, row: number, position: CellColorPosition = CellColorPosition.CENTER)

Source from the content-addressed store, hash-verified

1400 * @param row The 1-based row index to get the color for.
1401 */
1402async function getCellColor(ctx: ITestContext, col: number, row: number, position: CellColorPosition = CellColorPosition.CENTER): Promise<[red: number, green: number, blue: number, alpha: number]> {
1403 if (!frameDetails) {
1404 frameDetails = await getFrameDetails(ctx);
1405 }
1406 switch (position) {
1407 case CellColorPosition.CENTER:
1408 return getCellColorInner(frameDetails, col, row);
1409 case CellColorPosition.FIRST:
1410 return getCellColorFirstPoint(frameDetails, col, row);
1411 }
1412}
1413
1414let frameDetails: { cols: number, rows: number, decoded: IImage32 } | undefined = undefined;
1415async function getFrameDetails(ctx: ITestContext): Promise<{ cols: number, rows: number, decoded: IImage32 }> {

Callers 2

setupTestsFunction · 0.85

Calls 3

getFrameDetailsFunction · 0.85
getCellColorInnerFunction · 0.85
getCellColorFirstPointFunction · 0.85

Tested by

no test coverage detected