in reply to In Term::ANSIColor grey color is present or not.

I don’t use this module, but just looking through the documentation, it seems you have to specify a shade of grey in the range grey0 .. grey23. For example, print colored(['grey12'], "Text on grey color\n"); should work.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: In Term::ANSIColor grey color is present or not.
by Anonymous Monk on Mar 30, 2022 at 06:22 UTC

    grey0 also should work right but for me it is also getting error

    Invalid attribute name grey0

      Ok, I dusted off my old Cygwin terminal and got Term::ANSIColor working. grey0 looks the same as black, but prints fine with no error message. grey with no number gives the error message you reported first.

      I don’t know what to suggest. Maybe if you detail your setup (OS, Perl version, Term::ANSIColor version, terminal type) some of the other monks will be able to shed some light.

      Cheers,

      Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

      I am unable to reproduce your findings (with version 4.03):

      $ perl -MTerm::ANSIColor -e 'print color("grey0"), "foo\n", color("res +et")' foo $

      🦛