uawdijnntqw1x1x1
IP : 216.73.216.86
Hostname : 6.87.74.97.host.secureserver.net
Kernel : Linux 6.87.74.97.host.secureserver.net 4.18.0-553.83.1.el8_10.x86_64 #1 SMP Mon Nov 10 04:22:44 EST 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
emeraadmin
/
www
/
node_modules
/
d3-path
/
..
/
interpret
/
..
/
.bin
/
..
/
..
/
4d695
/
perl-Term-ANSIColor.tar
/
/
examples/generate-colors000064400000021441151702500670011403 0ustar00#!/usr/bin/perl # # Generate 256-color test files. # # Takes one or more of six arguments: basic, bright, fg256 (foreground), bg256 # (background), grey, or ansi256. Generates a test file for either basic ANSI # colors or 256-color emulators, testing that region of colors. # # This script requires Term::ANSIColor 4.00 or later already be installed or # that this script be run manually under Perl with flags pointing to where the # module is. # # Copyright 2012 Kurt Starsinic <kstarsinic@gmail.com> # Copyright 2012, 2014, 2016 Russ Allbery <rra@cpan.org> # # This program is free software; you may redistribute it and/or modify it # under the same terms as Perl itself. use 5.006; use strict; use warnings; use Carp qw(croak); use Term::ANSIColor 4.00 qw(color); # Screen width for centering headings. use constant SCREEN_WIDTH => 80; # The basic attributes and eight colors. use constant ATTRIBUTES => qw(bold dark italic underline blink concealed); use constant COLORS => qw(black red green yellow blue magenta cyan white); # print and printf with error checking. autodie unfortunately can't help us # with these because they can't be prototyped and hence can't be overridden. ## no critic (Subroutines::RequireArgUnpacking) sub print_checked { print @_ or croak('print failed'); return } sub printf_checked { printf @_ or croak('printf failed'); return } ## use critic # The sample background or foreground colors for 256-color tests. my @SAMPLES = qw(000 222 555); # The list of all possible RGB values. my @RGB; for my $r (0 .. 5) { for my $g (0 .. 5) { push(@RGB, map { "$r$g$_" } 0 .. 5); } } # Center a text string with spaces. # # $text - Text to center # $width - Width in which to center the text # # Returns: Text centered within that width sub center { my ($text, $width) = @_; my $padding = $width - length($text); my $trailing = int($padding / 2); my $leading = $padding - $trailing; return (q{ } x $leading) . $text . (q{ } x $trailing); } # Print out the test file that tries all the basic eight ANSI colors. # # Returns: undef # Throws: Text exception on I/O failure sub print_basic_test { print_checked("Basic ANSI colors (eight-color, or dim)\n\n"); for my $bg (COLORS) { printf_checked('%4s %-7s ', q{ }, $bg); for my $fg (COLORS) { print_checked(color($fg, "on_$bg"), center($fg, 8)); } print_checked(color('reset'), "\n"); printf_checked('%4s %-7s ', 'bold', $bg); for my $fg (COLORS) { print_checked(color($fg, 'bold', "on_$bg"), center($fg, 8)); } print_checked(color('reset'), "\n"); } print_checked("\nAttributes: "); for my $fg (ATTRIBUTES) { print_checked(center($fg, 10)); } print_checked("\n", q{ } x 12); for my $fg (ATTRIBUTES) { print_checked(color($fg), center('testing', 10), color('reset')); } print_checked("\n\n"); return; } # Print out the test file that tries all the bright colors from the # sixteen-color palette. # # Returns: undef # Throws: Text exception on I/O failure sub print_bright_test { print_checked("Bright ANSI colors (sixteen-color)\n\n"); for my $bg (COLORS) { printf_checked('%6s %-7s ', 'dim', $bg); for my $fg (COLORS) { my $escape = color("bright_$fg", "on_$bg"); print_checked($escape, center($fg, 8)); } print_checked(color('reset'), "\n"); printf_checked('%6s %-7s ', 'bright', $bg); for my $fg (COLORS) { my $escape = color("bright_$fg", "on_bright_$bg"); print_checked($escape, center($fg, 8)); } print_checked(color('reset'), "\n"); } print_checked("\n"); return; } # Print out the test file that tries all valid RGB foreground colors. # # Returns: undef # Throws: Text exception on I/O failure sub print_fg256_test { print_checked("RGB000 - RGB555 from 256-color palette (foreground)\n"); for my $bg (@SAMPLES) { for my $i (0 .. $#RGB) { if (($i % 18) == 0) { printf_checked("%s\nbg %03d %s", color('reset'), $bg, color("on_rgb$bg")); } printf_checked('%s%03d ', color("rgb$RGB[$i]"), $RGB[$i]); } } print_checked(color('reset'), "\n\n"); return; } # Print out the test file that tries all valid RGB background colors. # # Returns: undef # Throws: Text exception on I/O failure sub print_bg256_test { print_checked("RGB000 - RGB555 from 256-color palette (background)\n"); for my $fg (@SAMPLES) { for my $i (0 .. $#RGB) { if (($i % 18) == 0) { printf_checked("%s\nfg %03d %s", color('reset'), $fg, color("rgb$fg")); } printf_checked('%s%03d ', color("on_rgb$RGB[$i]"), $RGB[$i]); } } print_checked(color('reset'), "\n\n"); return; } # Print out the test file that shows all valid grey-scale colors. # # Returns: undef # Throws: Text exception on I/O failure sub print_grey_test { print_checked("Grey0 - Grey23 from 256-color palette\n\n"); for my $bg (0 .. 23) { printf_checked('%2d %s', $bg, color("on_grey$bg")); for my $fg (0 .. 23) { printf_checked('%s%d ', color("grey$fg"), $fg); } print_checked(color('reset'), "\n"); } print_checked("\n"); return; } # Print out the test file that shows the 16 ANSI colors from the 256-color # palette. # # Returns: undef # Throws: Text exception on I/O failure sub print_ansi256_test { print_checked("ANSI colors 0 - 15 from 256-color palette\n\n"); for my $bg (0 .. 15) { printf_checked('%2d %s', $bg, color("on_ansi$bg")); for my $fg (0 .. 15) { printf_checked('%s%d ', color("ansi$fg"), $fg); } print_checked(color('reset'), "\n"); } print_checked("\n"); return; } # Main routine. Scan @ARGV for which test files to print out. my %tests = ( basic => \&print_basic_test, bright => \&print_bright_test, fg256 => \&print_fg256_test, bg256 => \&print_bg256_test, grey => \&print_grey_test, ansi256 => \&print_ansi256_test, ); for my $file (@ARGV) { if ($tests{$file}) { $tests{$file}->(); } else { die "Unknown test file: $file\n"; } } __END__ =for stopwords fg256 bg256 RGB rgb000 rgb222 rgb555 ansi256 CPAN Starsinic Allbery grey grey-scale =head1 NAME generate-colors - Generate color test patterns for ANSI terminal support =head1 SYNOPSIS B<generate-colors> I<type> [I<type> ...] =head1 REQUIREMENTS Perl 5.6 and Term::ANSIColor 4.00 or later. =head1 DESCRIPTION B<generate-colors> generates test and demonstration tables for ANSI color and text attribute support for eight-color, sixteen-color, and 256-color terminal emulators. The I<type> command-line argument specifies a table to print to standard output. Multiple I<type> arguments can be specified, and each of those tables will be printed in the order given. The supported values of I<type> are: =over 8 =item basic The basic eight ANSI colors as both foreground and background, as well as examples of bold for each color and a separate table of the non-color text attributes supported by Term::ANSIColor. =item bright The "bright" ANSI colors from the sixteen-color palette (colors 8 through 15) on all possible color backgrounds (colors 0 through 15). =item fg256 All of the 216 colors in the 256-color palette that are specified by three RGB values (each from 0 to 5) as foreground colors, shown against three possible backgrounds (rgb000, rgb222, and rgb555). =item bg256 The same as C<fg256> except showing all of the background colors for three different possible foreground colors (rgb000, rgb222, and rgb555). =item grey The 24 grey-scale colors in the 256-color palette, shown as both foreground and background. =item ansi256 The 256-color palette devotes the lowest 16 colors to duplicating the colors from the sixteen-color palette. This test table shows all sixteen as both foreground and background colors, but using the 256-color escape sequence format to specify them. It's possible that this test will not work with some emulators that support C<basic> and C<bright> if 256-color support is not implemented. =back =head1 SEE ALSO L<Term::ANSIColor> This script is an example in the Term::ANSIColor distribution, available from its web site at L<https://www.eyrie.org/~eagle/software/ansicolor/> or from CPAN. =head1 AUTHORS Original script written by Kurt Starsinic. It was restructured and updated by Russ Allbery to add the C<basic> and C<bright> test tables. =head1 COPYRIGHT AND LICENSE Copyright 2012 Russ Allbery <rra@cpan.org>. Copyright 2012 Kurt Starsinic <kstarsinic@gmail.com>. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. =cut Changes000064400000025510151702500670006045 0ustar00 User-Visible Term::ANSIColor Changes Term::ANSIColor 4.06 (2016-10-28) Add aliases ansi16 through ansi255 and on_ansi16 through on_ansi255 (plus the corresponding constants) for the grey and rgb colors so that one can refer to all of the 256 ANSI colors with consistent names. These are aliases; the colors returned by uncolor will still use the grey and rgb names. (#118267) Term::ANSIColor 4.05 (2016-03-20) Color aliases are now restricted to ASCII alphanumerics, due to the below change. Delay loading of the Carp module and avoid using [:upper:], \w, and \d in regular expressions to reduce the amount of memory this module consumes. (Normally, I wouldn't worry about this, but this module is very light-weight and can be useful even in highly space-constrained environments, and the impact is slight.) Thanks, Nicolas R. (#111552) Provide a mailto address in bug tracking metadata, use the shorter form of the RT bug tracker URL, and fix the license value to match the new metadata specification. Rework Makefile.PL so that the munging for older versions of ExtUtils::MakeMaker is less intrusive. Term::ANSIColor 4.04 (2015-12-06) Revert the build system back to ExtUtils::MakeMaker. This is the build system actually used in Perl core, so this removes a level of indirectly generated files and means that normal module development tests the same build system used by Perl. Update Makefile.PL with the additional metadata from the Module::Build build system. For versions of Perl prior to 5.11, install the module into the Perl core module directories, since in those versions site modules did not take precedence over Perl core modules. Rename NEWS to Changes to match the normal Perl convention. Term::ANSIColor 4.03 (2014-03-23) Switch the module build system to Module::Build, but still generate a Makefile.PL file for backward compatibility and for the use of Perl core. Fix typo in SYNOPSIS (colorstrip example) and duplicated word. Thanks, Olivier Mengué and David Steinbrunner. (#85480, #94006) Skip POD and some other style tests unless doing automated or release testing. Skip POD spelling, coverage, and Perl::Critic tests unless doing author testing. Use the Lancaster Consensus environment variables instead of RRA_MAINTAINER_TESTS. (#93474) Add SEE ALSO reference to Win32::Console::ANSI. (#87295) Term::ANSIColor 4.02 (2013-01-07) When testing 256-color support, list the tag first in the import list for compatibility with the Exporter from Perl 5.6.2. Thanks to David Cantrell for the testing and debugging. Add the minimum Perl version to the package metadata. Term::ANSIColor 4.01 (2012-12-31) Fix logic for skipping tests when Test::Warn is not installed. Term::ANSIColor 4.00 (2012-12-30) Add constants (with tag :constants256) and attributes for 256-color emulators. Thanks, Kurt Starsinic. Add support for custom color names configured with either a new function, coloralias, or the ANSI_COLORS_ALIASES environment variable as set during module load. Thanks, Stephen Tirlwall. Only honor ANSI_COLORS_DISABLED if it is set to a true value. The module now requires Perl 5.6 or later and makes use of Perl 5.6 features. Replace the AUTOLOAD support for ANSI_COLORS_DISABLED with generation of constant subs that check for ANSI_COLORS_DISABLED when they're called. This fixes behavior if the constant were used before the environment variable was set and then used again afterwards. PUSHCOLOR now takes an array like all the other constant functions and joins all arguments together before manipulating them, making behavior more consistent in some edge cases. $AUTOLOCAL now takes precedence over $AUTORESET, reversing the previous behavior. It is also now properly documented. Add a COMPATIBILITY section to the documentation collecting all information about when features were introduced and adding the version of Perl that they shipped with. Add appropriate version numbers to the use statements in the SYNOPSIS. Add a new generate-colors example script that can generate various test and demonstration files, including for 256 colors and various attributes. Remove the VT100 test files, which had an unclear license. generate-colors can now generate better tests for everything of significance to this package. Term::ANSIColor 3.02 (2012-03-18) In AUTOLOAD, only return pass-through behavior if the function that was called was one of our constants, rather than turning every unknown function in the Term::ANSIColor namespace into a passthrough join function when colors are disabled. Add the italic attribute and the ITALIC constant. Document that support for it is rare. Preserve an existing value of $@ when generating a constant sub and restore it afterwards. Diagnose errors in creating the constant sub and die instead of ignoring them. Term::ANSIColor 3.01 (2011-07-20) In colored, only interpret an initial array reference as a list of colors, not any initial reference, allowing the colored function to work properly on objects with stringification defined. Thanks, Revilo Reegiles. Warn in the documentation that attributes are not supported in and will not work with Perl formats. Term::ANSIColor 3.00 (2010-01-04) Add bright versions of the basic eight foreground and background colors using the 9x and 10x codes, supported by emulators with 16 color support. Reword the explanation of bright and regular colors, and provide some advice about which to use. Reorganize the documentation and be clearer about the function interface parameters. Term::ANSIColor 2.02 (2009-08-30) Add the new function colorvalid, which takes an attribute and returns whether it's a known attribute. Add FAINT as a synonym for DARK and export it when constants are requested. Update the terminal compatibility matrix to reflect that xterm now supports blink. Term::ANSIColor 2.01 (2009-07-04) Add the new function colorstrip, which removes ANSI color codes from strings. Thanks, Paul Miller. When reporting errors for bad escape sequences in uncolor, don't include the leading \e[ or trailing m in the error message. Untaint $AUTOLOAD when generating constant subs, which is required by Perl 5.10 and later running in taint mode. Thanks, Tim Bellinghausen. Term::ANSIColor 2.00 (2009-02-28) Add new functions PUSHCOLOR, POPCOLOR, and LOCALCOLOR, which maintain a stack of colors using the constant syntax. PUSHCOLOR stores the attributes being set on its internal stack, POPCOLOR returns to the previous attribute set, and LOCALCOLOR surrounds its argument in PUSHCOLOR and POPCOLOR. If $AUTOLOCAL is set, each sequence of color constants will be implicitly preceded by LOCALCOLOR. This support was contributed by openmethods.com voice solutions. When AUTOLOAD is called to generate a constant sub and the environment variable ANSI_COLORS_DISABLED is set, return the stringified arguments rather than creating a sub. This allows colors to work later if ANSI_COLORS_DISABLED is unset rather than making its effects permanent. It also avoids adding a reset escape sequence when $AUTORESET and ANSI_COLORS_DISABLED are both set. Add faint as a synonym for dark. Fix spelling and markup errors in the documentation and improve the documentation of text attributes. Term::ANSIColor 1.12 (2007-04-22) Use the correct syntax for internal POD links in the documentation. Document cyan and white as supported attributes. Term::ANSIColor 1.11 (2006-06-22) Clarify in the documentation the behavior of terminals when background colors are set across newlines, and rewrite some of the examples to avoid doing things that confuse the terminal. Term::ANSIColor 1.10 (2005-08-21) Fix $EACHLINE handling of lines consisting solely of "0". Add terminal test files from Joe Smith to the distribution. Term::ANSIColor 1.09 (2004-12-03) Add compatibility information for Mac OS X Terminal to the terminal emulators table. Thanks, Daniel Lindsley. Term::ANSIColor 1.08 (2004-02-19) Export DARK as a constant. This was missed when dark was added as a supported attribute. Term::ANSIColor 1.07 (2003-03-25) Document the behavior of PuTTY, Windows telnet, and Cygwin OpenSSH in the terminal emulators table. Update the URL to the ECMA standard. Term::ANSIColor 1.06 (2002-12-09) Fix a typo in an L<> link in the documentation. Term::ANSIColor 1.05 (2002-06-28) Document the Windows consoles that don't work with this module. Update the documentation formatting style. Term::ANSIColor 1.04 (2001-07-10) Add a new uncolor function, which takes a set of escape sequences and returns a list of attribute names set by those escape sequences. This is the opposite function as color. If ANSI_COLORS_DISABLED is set in the environment, all of the functions and constants in this module become no-ops that pass through text without coloring it. Add information about the relevant standards to the documentation. Term::ANSIColor 1.03 (2000-08-06) In the colored function, allow the attributes to be passed as an initial array reference as well as a trailing list. When called with that syntax, all subsequent arguments are taken as text to be colored. Add the dark attribute. Improve the documentation by including a table of supported attributes on different terminal emulators in the documentation and documenting whether diagnostics are fatal errors or warnings. Install into the Perl library directory for Perl 5.6.0 or later, since this module is now part of core. Term::ANSIColor 1.02 (1998-11-27) Call croak instead of die if the AUTOLOAD function to synthesize constants fails. Set ABSTRACT and AUTHOR in Makefile.PL to support PPD generation for binary distributions or the Perl Resource Kits. Term::ANSIColor 1.01 (1997-12-10) Fix the call to carp when running under Perl versions later than 5.004_04, which no longer import Carp in strict.pm and thereby declare the function at compile time. Term::ANSIColor 1.00 (1997-11-29) Correctly handle trailing delimiters when $EACHLINE is set. Call croak instead of die if a caller uses an invalid attribute name, since the error is really at the call site. Add the correct rules to Makefile.PL to build a distribution. Term::ANSIColor 0.09 (1997-02-17) Initial public release. (Possibly. It's the oldest version available on BackPan and dates back to when the "package" version was based on the RCS revision of the ANSIColor.pm file.) README000064400000015033151702500670005431 0ustar00 Term::ANSIColor 4.06 (simple ANSI text attribute control module) Maintained by Russ Allbery <rra@cpan.org> Copyright 1996-1998, 2000-2002, 2005-2006, 2008-2016 Russ Allbery <rra@cpan.org>. Copyright 1996 Zenin. Copyright 2012 Kurt Starsinic <kstarsinic@gmail.com>. This software is distributed under the same terms as Perl itself. Please see the section LICENSE below for more information. BLURB Term::ANSIColor provides constants and simple functions for setting ANSI text attributes, most notably colors. It can be used to set the current text attributes or to apply a set of attributes to a string and reset the current text attributes at the end of that string. Eight-color, sixteen-color, and 256-color escape sequences are all supported. DESCRIPTION This Perl module is a simple and convenient interface to the ANSI terminal escape sequences for color (from ECMA-48, also included in ISO 6429). The color sequences are provided in two forms, either as constants for each color or via a function that takes the names of colors and returns the appropriate escape codes or wraps them around the provided text. The non-color text style codes from ANSI X3.64 (bold, dark, underline, and reverse, for example), which were also included in ECMA-48 and ISO 6429, are also supported. Also supported are the extended colors used for sixteen-color and 256-color emulators. This module is very stable, and I've used it in a wide variety of applications. It has been included in the core Perl distribution starting with version 5.6.0, so you don't need to download and install it yourself unless you have an old version of Perl or need a newer version of the module than comes with your version of Perl. I continue to maintain it as a separate module, and the version included in Perl is resynced with mine before each release. The original module came out of a discussion in comp.lang.perl.misc and is a combination of two approaches, one with constants by Zenin and one with functions that I wrote. I offered to maintain a combined module that included both approaches. REQUIREMENTS Term::ANSIColor is written in pure Perl and has no module dependencies that aren't found in Perl core. It should work with any version of Perl after 5.6, although it hasn't been tested with old versions in some time. In order to actually see color, you will need to use a terminal window that supports the ANSI escape sequences for color. Any recent version of xterm, most xterm derivatives and replacements, and most telnet and ssh clients for Windows and Macintosh should work, as will the MacOS X Terminal application (although Terminal.app reportedly doesn't support 256 colors). The console windows for Windows NT and Windows 2000 will not work, as they do not even attempt to support ANSI X3.64. For a complete (to my current knowledge) compatibility list, see the Term::ANSIColor module documentation. If you have any additions to the table in the documentation, please send them to me. The test suite requires Test::More (part of Perl since 5.6.2). The following additional Perl modules will be used by the test suite if present: * Devel::Cover * Test::MinimumVersion * Test::Perl::Critic * Test::Pod * Test::Pod::Coverage * Test::Spelling * Test::Strict * Test::Synopsis * Test::Warn All are available on CPAN. Those tests will be skipped if the modules are not available. To enable tests that don't detect functionality problems but are used to sanity-check the release, set the environment variable RELEASE_TESTING to a true value. To enable tests that may be sensitive to the local environment or that produce a lot of false positives without uncovering many problems, set the environment variable AUTHOR_TESTING to a true value. BUILDING AND INSTALLATION Term::ANSIColor uses ExtUtils::MakeMaker and can be installed using the same process as any other ExtUtils::MakeMaker module: perl Makefile.PL make make test make install You'll probably need to do the last as root unless you're installing into a local Perl module tree in your home directory. SUPPORT The Term::ANSIColor web page at: https://www.eyrie.org/~eagle/software/ansicolor/ will always have the current version of this package, the current documentation, and pointers to any additional resources. For bug tracking, use the CPAN bug tracker at: https://rt.cpan.org/Dist/Display.html?Name=Term-ANSIColor However, please be aware that I tend to be extremely busy and work projects often take priority. I'll save your report and get to it as soon as I can, but it may take me a couple of months. SOURCE REPOSITORY Term::ANSIColor is maintained using Git. You can access the current source on GitHub at: https://github.com/rra/ansicolor or by cloning the repository at: https://git.eyrie.org/git/perl/ansicolor.git or view the repository via the web at: https://git.eyrie.org/?p=perl/ansicolor.git The eyrie.org repository is the canonical one, maintained by the author, but using GitHub is probably more convenient for most purposes. Pull requests are gratefully reviewed and normally accepted. It's probably better to use the CPAN bug tracker than GitHub issues, though, to keep all Perl module issues in the same place. LICENSE The Term::ANSIColor package as a whole is covered by the following copyright statement and license: Copyright 1996-1998, 2000-2002, 2005-2006, 2008-2016 Russ Allbery <rra@cpan.org> Copyright 1996 Zenin Copyright 2012 Kurt Starsinic <kstarsinic@gmail.com> This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. This means that you may choose between the two licenses that Perl is released under: the GNU GPL and the Artistic License. Please see your Perl distribution for the details and copies of the licenses. PUSH/POP support submitted 2007 by openmethods.com voice solutions Some files in this distribution are individually released under different licenses, all of which are compatible with the above general package license but which may require preservation of additional notices. All required notices, and detailed information about the licensing of each file, are recorded in the LICENSE file. For any copyright range specified by files in this package as YYYY-ZZZZ, the range specifies every single year in that closed interval.
/home/emeraadmin/www/node_modules/d3-path/../interpret/../.bin/../../4d695/perl-Term-ANSIColor.tar