I had logged off but, as I was shutting down for the evening, I thought of some additional tests you could do (based on the "Term::ANSIColor - Supported Colors" I linked in my last post).

If these work, your terminal supports 256 colours:

$ perl -E 'use Term::ANSIColor; use Data::Dump; my $x = colored("black + on white", "rgb000 on_white"); say $x; dd $x' black on white "\e[38;5;16;47mblack on white\e[0m" $ perl -E 'say "\e[38;5;16;47mblack on white\e[0m"' black on white

If not, these should still work (indicating you have 8 or 16 colour support):

$ perl -E 'use Term::ANSIColor; use Data::Dump; my $x = colored("black + on white", "black on_white"); say $x; dd $x' black on white "\e[30;47mblack on white\e[0m" $ perl -E 'say "\e[30;47mblack on white\e[0m"' black on white

For me, all of those give black text on a white background.

If you're down to determining whether you have 8 or 16 colour support, try these.

$ perl -E 'use Term::ANSIColor; say colored("red text", "red on_white" +)' red text $ perl -E 'use Term::ANSIColor; say colored("red text", "bright_red on +_white")' red text

If the second of those looks brighter, you have 16 colour support. If they look the same, it's 8 colour support.

You might consider putting some, or all, of those in a script. That might help when trying various TERM settings (although, be aware that, without the ability to test on MSWin, I am somewhat guessing).

— Ken


In reply to Re^4: 'rgb_palette' - Term::ANSIColor Helper -- errors on strawberry by kcott
in thread 'rgb_palette' - Term::ANSIColor Helper by kcott

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.