Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper button to print a wide range of ansi colors #3850

Closed
Tyriar opened this issue Jun 2, 2022 · 8 comments · Fixed by #3991
Closed

Add helper button to print a wide range of ansi colors #3850

Tyriar opened this issue Jun 2, 2022 · 8 comments · Fixed by #3991
Labels
area/demo help wanted type/enhancement Features or improvements to existing features
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 2, 2022

Similar to the box drawing and powerlines buttons in the test tab of the demo, a helper for printing out different color modes would be of great help. Something like this to give an idea, but that prints every color (a separate button for each color mode?)

echo -e '\x1b[0mDefault'
echo -e '\x1b[7mDefault (inverse)\x1b[0m'
echo -e '\x1b[33mPalette 16 (color #3, yellow)\x1b[0m'
echo -e '\x1b[38;5;50mPalette 256 (color #50)\x1b[0m'
echo -e '\x1b[38;2;255;0;0mRGB/True color (color #FF0000)\x1b[0m'
@deepanshu44
Copy link
Contributor

Hello @Tyriar , In this particular issue, is it required to print something like this?

@Tyriar
Copy link
Member Author

Tyriar commented Jul 24, 2022

@deepanshu44 basically yeah, but also including true color and both foreground and background styles.

@deepanshu44
Copy link
Contributor

deepanshu44 commented Jul 24, 2022

Forgive my ignorance, but I am unaware of what true colors are.
And also, what do you mean by both foreground and background styles and color mode?

Edit: I think this issue requires some extra knowledge, therefore, I should drop this and look into other issues.

@Tyriar
Copy link
Member Author

Tyriar commented Jul 24, 2022

@deepanshu44 np. FYI these are just the different types of colors, the 38;2 above is true color, foreground uses 3x, background uses 4x

@deepanshu44
Copy link
Contributor

@Tyriar Thanks for providing FYI, I understood what's supposed to be done.

If I am correct than, the end results should look something like this displaying 256 colors.

@Tyriar
Copy link
Member Author

Tyriar commented Jul 24, 2022

@deepanshu44 yep 👍

@deepanshu44
Copy link
Contributor

deepanshu44 commented Jul 31, 2022

Hello @Tyriar , I need to ask whether in order to display colours, are we required to use a script or write term.write() multiple times or there is a different approach?

Both ways are fine for me.

@Tyriar
Copy link
Member Author

Tyriar commented Jul 31, 2022

The term.write approach is best as a script wouldn't work across all shells/operating systems. For the order, something like how underline colors are show (0-255, then some color ramps?):
Screen Shot 2022-07-31 at 3 24 30 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/demo help wanted type/enhancement Features or improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants