TTY detection foreground/background color
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
未指定實作檔案或測試。首先定位用於查詢終端色深的現有 stream API,然後檢查在受支援的平台上如何處理 TTY 行為。當一個已定義的 stream 函式能夠查詢前景色,並在可能的情況下查詢背景色,且相關情況都有涵蓋時,即視為完成。
由索引模型根據 Issue 內容生成。
描述
What is the problem this feature will solve?
For tty’s if you output any text in black, particularly when doing TUI’s one is likely to get a rude awakening when they discover that their users are using dark mode and none of that text is visible because it’s jet black on a charcoal gray background. It would be best in such cases to simply print this text in the default foreground color, but that does not guarantee that other colors will be high contrast. For instance dark blue on charcoal gray, or yellow text on iTerm's default eggshell white background, versus orange which shows well on both light and dark mode terminals.
What is the feature you are proposing to solve the problem?
Add a function to write stream to query the foreground color the way color depth can be queried. And if at all possible, also the background color.
What alternatives have you considered?
Workarounds include:
- setting a background color and printing over it, but that makes the text/graphic look more important than it is
- resetting the tty codes rather than setting “black” - but this fails if you are looking for a more general case of high contrast colors, like dark gray on a bright background and light gray on a dark one.
- 主要語言
- JavaScript
- 星號
- 122k
- 分支
- 38.4k
- 平均合併
- 4 天 10 小時
- 30 天內合併 PR
- 291
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
nodejs/node 的其他 Issue
-
doc
難度 1/5 1 小時以內 新手友好度 90/100
維護者通常 1 天內回覆
-
doc
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
build
難度 1/5 1 小時以內 新手友好度 88/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
nodejs/node#65994 · 2 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
-
feature request
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
saadeghi/daisyui#4780 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
-
accessibility bug embed websites
難度 2/5 1-3 小時 新手友好度 78/100
quarto-dev/quarto-cli#14972 ·
維護者通常 1 天內回覆
-
has-readme needs-attention new-tool repo-verified
難度 2/5 1-3 小時 新手友好度 65/100
shanselman/TinyToolTown#834 · 2 則留言 ·
維護者通常 6 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
siderolabs/talos-design-system#16 ·
維護者通常 1 天內回覆