feat(ui): add solid background color option for input prompt (#16563)

Co-authored-by: Alexander Farber <farber72@outlook.de>
This commit is contained in:
Jacob Richman
2026-01-26 15:23:54 -08:00
committed by GitHub
parent 7fbf470373
commit b5fe372b5b
40 changed files with 898 additions and 420 deletions

View File

@@ -0,0 +1,22 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import process from 'node:process';
/**
* Returns the color depth of the current terminal.
* Returns 24 (TrueColor) if unknown or not a TTY.
*/
export function getColorDepth(): number {
return process.stdout.getColorDepth ? process.stdout.getColorDepth() : 24;
}
/**
* Returns true if the terminal has low color depth (less than 24-bit).
*/
export function isLowColorDepth(): boolean {
return getColorDepth() < 24;
}