C++ Logo

std-proposals

Advanced search

Re: Color Text Output

From: Михаил Найденов <mihailnajdenov_at_[hidden]>
Date: Sat, 26 Jun 2021 11:32:55 +0300
On Sat, Jun 26, 2021 at 10:19 AM Ed B via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> C++ is supposed to be a professional language for development of
> applications across a wide range of industries. Had you considered how many
> of those industries would want something like colored text output?
>
> I would guess probably less than 5 % would have any interest in such a
> thing.
>
> This is not really something which is suitable for inclusion into the core
> of the language.
>
> There are a lot more things which are higher priority than this, and even
> if there were not, C++ is already a monolith which arguably could benefit
> from being split up or overhauled in some way, so adding yet more features
> to it which very few people are likely to use really isn't a good idea.
>
> We only just got proper cross platform filesystem support in C++17 and
> this was something that existed in boost for decades prior.
>

I agree, though a very, very, very simple solution might be nice. This
better not be another "graphics" proposal




> ------------------------------
> *From:* Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf
> of David Braun via Std-Proposals <std-proposals_at_[hidden]>
> *Sent:* Saturday, June 26, 2021 02:10
> *To:* std-proposals_at_[hidden] <std-proposals_at_[hidden]>
> *Cc:* David Braun <da.braun1_at_[hidden]>
> *Subject:* Re: [std-proposals] Color Text Output
>
>
> Wow, yours is way more advanced and fleshed out than my suggestion. You
> obviously know a lot more about advanced terminal output than me.
>
>
>
> Have you considered writing a proposal to include it in the standard?
>
>
>
> I think if we do get Colored Text Output in the console in standard C++
> we need to do it right the first time (we don’t want a situation like
> std::regex) so I think you should try getting your library into the
> standard.
>
>
>
> You would probably have to add some things to it get it to work in native
> (non-emulated terminals).
>
>
>
> I would also suggest that you put your list of colors in an enum class
> and/or change them from std::string to const char so that they’d be stack
> allocated instead of heap allocated, although it might not matter in the
> context of IO.
>
>
>
> Also maybe look at which if any modern C++ features you can take advantage
> of because this is pretty C-Like (the committee doesn’t really like that as
> far as I know.)
>
>
>
> Very impressive. You really should write a proposal.
>
>
>
> David Aaron Braun
>
> 519-680-9822
>
> 226-236-4898
>
> da.braun1_at_[hidden]
>
>
>
> *From:* Std-Proposals <std-proposals-bounces_at_[hidden]> *On Behalf
> Of *Bill Kerney via Std-Proposals
> *Sent:* Friday, June 25, 2021 6:32 PM
> *To:* C++ STD Proposals (std-proposals_at_[hidden]) <
> std-proposals_at_[hidden]>
> *Cc:* Bill Kerney <bkerney_at_[hidden]>
> *Subject:* Re: [std-proposals] Color Text Output
>
>
>
> I have a color library that does enum-based colors, as well as 24-bit
> color. I used it to make a text-based image renderer that works inside of
> PuTTY or other terminals that support 24-bit color. I couldn't use NCURSES
> since, well, you can read what Dickey wrote about it here:
> https://invisible-island.net/ncurses/ncurses.faq.html#xterm_16MegaColors
>
>
>
> Here's my git repo for it: https://github.com/ShakaUVM/colors
>
>
>
> It also enables non-blocking I/O from the keyboard (which is something
> that honestly should be a standard option in C++), enables mouse support
> inside a terminal, getting the terminal size, and so forth. It's not as
> powerful as NCURSES, but works reasonably well on modern terminals (I have
> no desire to support old terminals, which is an advantage NCURSES has). You
> can compare your implementation against mine and copy anything you like
> from it.
>
>
>
> Here's a screenshot of a Monet rendered inside PuTTY:
> https://user-images.githubusercontent.com/8254997/123489896-d42f2600-d5c7-11eb-8a81-c0989abe0224.png
>
>
>
> Bill Kerney
>
> Clovis Community College
>
>
>
>
> ------------------------------
>
> *From:* Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf
> of David Braun via Std-Proposals <std-proposals_at_[hidden]>
> *Sent:* Friday, June 25, 2021 12:14 AM
> *To:* C++ STD Proposals (std-proposals_at_[hidden]) <
> std-proposals_at_[hidden]>
> *Cc:* David Braun <da.braun1_at_[hidden]>
> *Subject:* [std-proposals] Color Text Output
>
>
>
> I propose to add colored text output to the C++ standard via the <iomanip>
> header. See the attached document for details.
>
> I am looking for feedback, particularly for the ANSI (Linux/Unix/Mac)
> implementation.
>
>
>
> I was also wondering if anyone could tell me what happened to the C++
> (14?) proposal for std::audio; is that project dead?
>
>
>
> I’d also like to know if the idea for constexpr function parameters which
> has been floated since around C++17 is being seriously considered or not.
>
> Like this:
>
>
>
> Now: Discussed:
>
> <template double d> void myFunc(constexpr double d){}
>
> void myFunc(){}
>
>
>
> Thanks!
>
>
>
> David Aaron Braun
>
> 519-680-9822
>
> 226-236-4898
>
> da.braun1_at_[hidden]
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2021-06-26 03:33:13