logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

"Convert::Color::VGA" - named lookup for the basic VGA colors

Author

       Paul Evans <leonerd@leonerd.org.uk>

perl v5.40.0                                       2024-09-16                           Convert::Color::VGA(3pm)

Constructor

new
          $color = Convert::Color::VGA->new( $name );

       Returns a new object to represent the named color.

          $color = Convert::Color::VGA->new( $index );

       Returns a new object to represent the color at the given index.

Description

       This subclass of Convert::Color::RGB provides predefined colors for the 8 basic VGA colors. Their names
       are

          black
          red
          green
          yellow
          blue
          magenta
          cyan
          white

       They may be looked up either by name, or by numerical index within this list.

Methods

index
          $index = $color->index;

       The index of the VGA color.

   name
          $name = $color->name;

       The name of the VGA color.

Name

       "Convert::Color::VGA" - named lookup for the basic VGA colors

See Also

       •   Convert::Color - color space conversions

Synopsis

       Directly:

          use Convert::Color::VGA;

          my $red = Convert::Color::VGA->new( 'red' );

          # Can also use index
          my $black = Convert::Color::VGA->new( 0 );

       Via Convert::Color:

          use Convert::Color;

          my $cyan = Convert::Color->new( 'vga:cyan' );

See Also