It's down to the version of Term::ANSIColor.

I had Strawberry 5.30.0.1's default Term::ANSIColor v4.06, and it gave me the same error Discipulus saw. I tried

@echo =================== 8 v 16 perl -E "use Term::ANSIColor; say my $x=colored('red text', 'red on_wh +ite'); use Data::Dump; dd $x" perl -E "use Term::ANSIColor; say my $x=colored('red text', 'bright_re +d on_white'); use Data::Dump; dd $x" perl -E "use Term::ANSIColor; use Data::Dump; my $x = colored('black o +n white', 'black on_white'); say $x; dd $x" @echo =================== 256 vs 8 or 16 perl -E "use Term::ANSIColor; use Data::Dump; my $x = colored('black o +n white', 'rgb000 on_white'); say $x; dd $x" @echo =================== [id://11146167] perl -E "use Term::ANSIColor; use Data::Dump; my $x = colored('black o +n white', 'r0g0b0 on_white'); say $x; dd $x" perl -E "say qq(\e[38;5;16;47mblack on white\e[0m)" perl -E "say qq(\e[38;2;0;0;0;47mblack on white\e[0m)" perl -E "say qq(\e[38;2;255;0;0;47mred on white\e[0m)" perl -E "say qq(\e[38;2;0;127;0;47mgreen on white\e[0m)" perl -E "say qq(\e[38;2;0;0;255;47mblue on white\e[0m)" perl -E "say qq(\e[38;2;191;127;191;47mpurple on white\e[0m)" perl -E "use Term::ANSIColor; use Config; say for $Term::ANSIColor::VE +RSION, $], $Config{myuname};"
... And everything but the r0g0b0 worked†; the r0g0b0 gave Invalid attribute name r0g0b0 at -e line 1.

I then realized that since kcott was using v5.36, there was probably a newer Term::ANSIColor , so then I ran cpanm Term::ANSIColor, which installed 5.01. When I ran my same batch script with the updated module, it worked without the error.

So Discipulus, you need to update Term::ANSIColor. Per their change list, rNNNgNNNbNNN notation was added in 5.00.

(To get the colors to work, I did use the VirtualTerminalLevel = 1 that the AM recommended)


edit: †: with full 24 bit color working fine for the red, green, blue, and purple, using manual escape sequences.

In reply to Re^5: 'rgb_palette' - Term::ANSIColor Helper -- errors on strawberry by pryrt
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.