pythontuirich

Pre-existing high-contrast palettes from the ANSI color set, to use in a terminal app?


Looking to convey more information in a Rich Table by using colors (specifically to track which modules given classes come from).

On the web, it's fairly easy on find color palettes that are optimized for contrast, rather than esthetics. Here's a 6 color example. Then it's just question of using the RGB/HSL specs to drive your CSS.

Rich has a nice list of ANSI colors in rich.colors.ANSI_COLOR_NAMES. But there is no indication of what colors would constitute a high-contrast 10-12 color palette.

Are there such lists available, for ANSI colors to be used in terminal apps? Or should I just find a web palette and use rich.colors.Color.from_rgb() to build myself such a palette?


Solution

  • Consider using Rich's themes to give names to your colors. That way you won't have to reference your list. You can do print("Hello [color3]World![/]")