r73847 - in /branches/upstream/libconvert-color-perl/current: ./ examples/ lib/Convert/ lib/Convert/Color/ t/

mxey-guest at users.alioth.debian.org mxey-guest at users.alioth.debian.org
Sat Apr 30 12:44:45 UTC 2011


Author: mxey-guest
Date: Sat Apr 30 12:43:05 2011
New Revision: 73847

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=73847
Log:
[svn-upgrade] new version libconvert-color-perl (0.08)

Added:
    branches/upstream/libconvert-color-perl/current/META.json
    branches/upstream/libconvert-color-perl/current/examples/gradient.pl
Modified:
    branches/upstream/libconvert-color-perl/current/Changes
    branches/upstream/libconvert-color-perl/current/LICENSE
    branches/upstream/libconvert-color-perl/current/MANIFEST
    branches/upstream/libconvert-color-perl/current/META.yml
    branches/upstream/libconvert-color-perl/current/Makefile.PL
    branches/upstream/libconvert-color-perl/current/lib/Convert/Color.pm
    branches/upstream/libconvert-color-perl/current/lib/Convert/Color/CMY.pm
    branches/upstream/libconvert-color-perl/current/lib/Convert/Color/CMYK.pm
    branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HSL.pm
    branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HSV.pm
    branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HueBased.pm
    branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB.pm
    branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB16.pm
    branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB8.pm
    branches/upstream/libconvert-color-perl/current/lib/Convert/Color/VGA.pm
    branches/upstream/libconvert-color-perl/current/lib/Convert/Color/X11.pm
    branches/upstream/libconvert-color-perl/current/t/30vga.t
    branches/upstream/libconvert-color-perl/current/t/31x11.t

Modified: branches/upstream/libconvert-color-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/Changes?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/Changes (original)
+++ branches/upstream/libconvert-color-perl/current/Changes Sat Apr 30 12:43:05 2011
@@ -1,4 +1,11 @@
 Revision history for Convert-Color
+
+0.08    CHANGES:
+         * Fix VGA colours so the indices agree with VT100/ANSI colour
+           numbering
+         * Don't rely on rgb8:255,255,255 as X11 being called 'white' during
+           testing
+         * Added an example script for generating gradients
 
 0.07    CHANGES:
          * Add warnings in 'deprecated' category for AUTOLOAD and COLOR_SPACE

Modified: branches/upstream/libconvert-color-perl/current/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/LICENSE?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/LICENSE (original)
+++ branches/upstream/libconvert-color-perl/current/LICENSE Sat Apr 30 12:43:05 2011
@@ -1,4 +1,4 @@
-This software is copyright (c) 2010 by Paul Evans <leonerd at leonerd.org.uk>.
+This software is copyright (c) 2011 by Paul Evans <leonerd at leonerd.org.uk>.
 
 This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@
 
 --- The GNU General Public License, Version 1, February 1989 ---
 
-This software is Copyright (c) 2010 by Paul Evans <leonerd at leonerd.org.uk>.
+This software is Copyright (c) 2011 by Paul Evans <leonerd at leonerd.org.uk>.
 
 This is free software, licensed under:
 
@@ -270,7 +270,7 @@
 
 --- The Artistic License 1.0 ---
 
-This software is Copyright (c) 2010 by Paul Evans <leonerd at leonerd.org.uk>.
+This software is Copyright (c) 2011 by Paul Evans <leonerd at leonerd.org.uk>.
 
 This is free software, licensed under:
 

Modified: branches/upstream/libconvert-color-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/MANIFEST?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/MANIFEST (original)
+++ branches/upstream/libconvert-color-perl/current/MANIFEST Sat Apr 30 12:43:05 2011
@@ -1,5 +1,6 @@
 Build.PL
 Changes
+examples/gradient.pl
 examples/html-sample.pl
 lib/Convert/Color.pm
 lib/Convert/Color/CMY.pm
@@ -34,3 +35,4 @@
 t/30vga.t
 t/31x11.t
 t/99pod.t
+META.json

Added: branches/upstream/libconvert-color-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/META.json?rev=73847&op=file
==============================================================================
--- branches/upstream/libconvert-color-perl/current/META.json (added)
+++ branches/upstream/libconvert-color-perl/current/META.json Sat Apr 30 12:43:05 2011
@@ -1,0 +1,83 @@
+{
+   "abstract" : "color space conversions and named lookups",
+   "author" : [
+      "Paul Evans <leonerd at leonerd.org.uk>"
+   ],
+   "dynamic_config" : 1,
+   "generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.110930",
+   "license" : [
+      "perl_5"
+   ],
+   "meta-spec" : {
+      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+      "version" : "2"
+   },
+   "name" : "Convert-Color",
+   "prereqs" : {
+      "build" : {
+         "requires" : {
+            "Test::More" : 0
+         }
+      },
+      "configure" : {
+         "requires" : {
+            "Module::Build" : "0.38"
+         }
+      },
+      "runtime" : {
+         "requires" : {
+            "List::UtilsBy" : 0,
+            "Module::Pluggable" : 0
+         }
+      }
+   },
+   "provides" : {
+      "Convert::Color" : {
+         "file" : "lib/Convert/Color.pm",
+         "version" : "0.08"
+      },
+      "Convert::Color::CMY" : {
+         "file" : "lib/Convert/Color/CMY.pm",
+         "version" : "0.08"
+      },
+      "Convert::Color::CMYK" : {
+         "file" : "lib/Convert/Color/CMYK.pm",
+         "version" : "0.08"
+      },
+      "Convert::Color::HSL" : {
+         "file" : "lib/Convert/Color/HSL.pm",
+         "version" : "0.08"
+      },
+      "Convert::Color::HSV" : {
+         "file" : "lib/Convert/Color/HSV.pm",
+         "version" : "0.08"
+      },
+      "Convert::Color::RGB" : {
+         "file" : "lib/Convert/Color/RGB.pm",
+         "version" : "0.08"
+      },
+      "Convert::Color::RGB16" : {
+         "file" : "lib/Convert/Color/RGB16.pm",
+         "version" : "0.08"
+      },
+      "Convert::Color::RGB8" : {
+         "file" : "lib/Convert/Color/RGB8.pm",
+         "version" : "0.08"
+      },
+      "Convert::Color::VGA" : {
+         "file" : "lib/Convert/Color/VGA.pm",
+         "version" : "0.08"
+      },
+      "Convert::Color::X11" : {
+         "file" : "lib/Convert/Color/X11.pm",
+         "version" : "0.08"
+      }
+   },
+   "release_status" : "stable",
+   "resources" : {
+      "license" : [
+         "http://dev.perl.org/licenses/"
+      ]
+   },
+   "version" : "0.08"
+}

Modified: branches/upstream/libconvert-color-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/META.yml?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/META.yml (original)
+++ branches/upstream/libconvert-color-perl/current/META.yml Sat Apr 30 12:43:05 2011
@@ -5,8 +5,9 @@
 build_requires:
   Test::More: 0
 configure_requires:
-  Module::Build: 0.36
-generated_by: 'Module::Build version 0.3607'
+  Module::Build: 0.38
+dynamic_config: 1
+generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.110930'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -15,37 +16,37 @@
 provides:
   Convert::Color:
     file: lib/Convert/Color.pm
-    version: 0.07
+    version: 0.08
   Convert::Color::CMY:
     file: lib/Convert/Color/CMY.pm
-    version: 0.07
+    version: 0.08
   Convert::Color::CMYK:
     file: lib/Convert/Color/CMYK.pm
-    version: 0.07
+    version: 0.08
   Convert::Color::HSL:
     file: lib/Convert/Color/HSL.pm
-    version: 0.07
+    version: 0.08
   Convert::Color::HSV:
     file: lib/Convert/Color/HSV.pm
-    version: 0.07
+    version: 0.08
   Convert::Color::RGB:
     file: lib/Convert/Color/RGB.pm
-    version: 0.07
+    version: 0.08
   Convert::Color::RGB16:
     file: lib/Convert/Color/RGB16.pm
-    version: 0.07
+    version: 0.08
   Convert::Color::RGB8:
     file: lib/Convert/Color/RGB8.pm
-    version: 0.07
+    version: 0.08
   Convert::Color::VGA:
     file: lib/Convert/Color/VGA.pm
-    version: 0.07
+    version: 0.08
   Convert::Color::X11:
     file: lib/Convert/Color/X11.pm
-    version: 0.07
+    version: 0.08
 requires:
   List::UtilsBy: 0
   Module::Pluggable: 0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.07
+version: 0.08

Modified: branches/upstream/libconvert-color-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/Makefile.PL?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/Makefile.PL (original)
+++ branches/upstream/libconvert-color-perl/current/Makefile.PL Sat Apr 30 12:43:05 2011
@@ -1,4 +1,4 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.3607
+# Note: this file was auto-generated by Module::Build::Compat version 0.3800
 use ExtUtils::MakeMaker;
 WriteMakefile
 (

Added: branches/upstream/libconvert-color-perl/current/examples/gradient.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/examples/gradient.pl?rev=73847&op=file
==============================================================================
--- branches/upstream/libconvert-color-perl/current/examples/gradient.pl (added)
+++ branches/upstream/libconvert-color-perl/current/examples/gradient.pl Sat Apr 30 12:43:05 2011
@@ -1,0 +1,42 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Convert::Color;
+use Getopt::Long;
+
+my $steps = 10;
+my $space = "hsv";
+my $html;
+
+GetOptions(
+   'number|n=i' => \$steps,
+   'space=s' => \$space,
+   'html' => \$html,
+) or exit 1;
+
+my $as_space = "as_$space";
+
+my @start = Convert::Color->new( shift @ARGV || die "No start colour\n" )->$as_space->$space;
+my @end   = Convert::Color->new( shift @ARGV || die "No end colour\n" )->$as_space->$space;
+
+print qq[<html><body><table>\n] if $html;
+
+foreach ( 0 .. $steps ) {
+   my $alpha = $_ / $steps;
+
+   my $col = Convert::Color->new( "$space:" . join ",", map { (1-$alpha) * $start[$_] + $alpha * $end[$_] } 0 .. 2 );
+
+   my $rgb = $col->as_rgb8;
+
+   if( $html ) {
+      my $hex = $rgb->hex;
+      printf qq[<tr><td style="background-color: #%s">#%s</td></tr>\n], $hex, $hex;
+   }
+   else {
+      printf "%s  h: %3s, s: %3s, v: %3s\n", $rgb->hex, $col->hue, $col->saturation, $col->value;
+   }
+}
+
+print qq[</table></body></html>\n] if $html;

Modified: branches/upstream/libconvert-color-perl/current/lib/Convert/Color.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/lib/Convert/Color.pm?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/lib/Convert/Color.pm (original)
+++ branches/upstream/libconvert-color-perl/current/lib/Convert/Color.pm Sat Apr 30 12:43:05 2011
@@ -16,7 +16,7 @@
                       search_path => [ 'Convert::Color' ];
 my @plugins = Convert::Color->plugins;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 =head1 NAME
 
@@ -439,11 +439,10 @@
    };
 }
 
-# Keep perl happy; keep Britain tidy
-1;
-
-__END__
-
 =head1 AUTHOR
 
 Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;

Modified: branches/upstream/libconvert-color-perl/current/lib/Convert/Color/CMY.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/lib/Convert/Color/CMY.pm?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/lib/Convert/Color/CMY.pm (original)
+++ branches/upstream/libconvert-color-perl/current/lib/Convert/Color/CMY.pm Sat Apr 30 12:43:05 2011
@@ -13,7 +13,7 @@
 
 use Carp;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 =head1 NAME
 
@@ -140,11 +140,6 @@
    $class->new( 1 - $r, 1 - $g, 1 - $b );
 }
 
-# Keep perl happy; keep Britain tidy
-1;
-
-__END__
-
 =head1 SEE ALSO
 
 =over 4
@@ -166,3 +161,7 @@
 =head1 AUTHOR
 
 Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;

Modified: branches/upstream/libconvert-color-perl/current/lib/Convert/Color/CMYK.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/lib/Convert/Color/CMYK.pm?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/lib/Convert/Color/CMYK.pm (original)
+++ branches/upstream/libconvert-color-perl/current/lib/Convert/Color/CMYK.pm Sat Apr 30 12:43:05 2011
@@ -15,7 +15,7 @@
 
 use Carp;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 =head1 NAME
 
@@ -201,11 +201,6 @@
    return $class->new_cmy( $cmy->cyan, $cmy->magenta, $cmy->yellow );
 }
 
-# Keep perl happy; keep Britain tidy
-1;
-
-__END__
-
 =head1 SEE ALSO
 
 =over 4
@@ -223,3 +218,7 @@
 =head1 AUTHOR
 
 Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;

Modified: branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HSL.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HSL.pm?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HSL.pm (original)
+++ branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HSL.pm Sat Apr 30 12:43:05 2011
@@ -13,7 +13,7 @@
 
 use Carp;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 =head1 NAME
 
@@ -180,11 +180,6 @@
    return $class->new( $hue, $s, $l );
 }
 
-# Keep perl happy; keep Britain tidy
-1;
-
-__END__
-
 =head1 SEE ALSO
 
 =over 4
@@ -202,3 +197,7 @@
 =head1 AUTHOR
 
 Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;

Modified: branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HSV.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HSV.pm?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HSV.pm (original)
+++ branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HSV.pm Sat Apr 30 12:43:05 2011
@@ -13,7 +13,7 @@
 
 use Carp;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 =head1 NAME
 
@@ -185,11 +185,6 @@
    );
 }
 
-# Keep perl happy; keep Britain tidy
-1;
-
-__END__
-
 =head1 SEE ALSO
 
 =over 4
@@ -207,3 +202,7 @@
 =head1 AUTHOR
 
 Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;

Modified: branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HueBased.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HueBased.pm?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HueBased.pm (original)
+++ branches/upstream/libconvert-color-perl/current/lib/Convert/Color/HueBased.pm Sat Apr 30 12:43:05 2011
@@ -44,5 +44,4 @@
    return ( $hue, $min, $max );
 }
 
-# Keep perl happy; keep Britain tidy
-1;
+0x55AA;

Modified: branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB.pm?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB.pm (original)
+++ branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB.pm Sat Apr 30 12:43:05 2011
@@ -1,7 +1,7 @@
 #  You may distribute under the terms of either the GNU General Public License
 #  or the Artistic License (the same terms as Perl itself)
 #
-#  (C) Paul Evans, 2009 -- leonerd at leonerd.org.uk
+#  (C) Paul Evans, 2009-2011 -- leonerd at leonerd.org.uk
 
 package Convert::Color::RGB;
 
@@ -13,7 +13,7 @@
 
 use Carp;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 =head1 NAME
 
@@ -208,10 +208,19 @@
    return $dr*$dr + $dg*$dg + $db*$db;
 }
 
-# Keep perl happy; keep Britain tidy
-1;
-
-__END__
+=head1 EXAMPLES
+
+=head2 Generating Gradients
+
+The C<alpha_blend> method can be used to generate a smooth gradient between
+two colours.
+
+ use Convert::Color;
+ 
+ my $blue = Convert::Color->new("vga:blue");
+ my $cyan = Convert::Color->new("vga:cyan");
+ 
+ say $blue->alpha_blend( $cyan, $_/10 )->as_rgb8->hex for 0 .. 10
 
 =head1 SEE ALSO
 
@@ -234,3 +243,7 @@
 =head1 AUTHOR
 
 Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;

Modified: branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB16.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB16.pm?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB16.pm (original)
+++ branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB16.pm Sat Apr 30 12:43:05 2011
@@ -13,7 +13,7 @@
 
 use Carp;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 =head1 NAME
 
@@ -271,11 +271,6 @@
    return $dr*$dr + $dg*$dg + $db*$db;
 }
 
-# Keep perl happy; keep Britain tidy
-1;
-
-__END__
-
 =head1 SEE ALSO
 
 =over 4
@@ -289,3 +284,7 @@
 =head1 AUTHOR
 
 Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;

Modified: branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB8.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB8.pm?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB8.pm (original)
+++ branches/upstream/libconvert-color-perl/current/lib/Convert/Color/RGB8.pm Sat Apr 30 12:43:05 2011
@@ -13,7 +13,7 @@
 
 use Carp;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 =head1 NAME
 
@@ -272,11 +272,6 @@
    return $dr*$dr + $dg*$dg + $db*$db;
 }
 
-# Keep perl happy; keep Britain tidy
-1;
-
-__END__
-
 =head1 SEE ALSO
 
 =over 4
@@ -290,3 +285,7 @@
 =head1 AUTHOR
 
 Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;

Modified: branches/upstream/libconvert-color-perl/current/lib/Convert/Color/VGA.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/lib/Convert/Color/VGA.pm?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/lib/Convert/Color/VGA.pm (original)
+++ branches/upstream/libconvert-color-perl/current/lib/Convert/Color/VGA.pm Sat Apr 30 12:43:05 2011
@@ -1,7 +1,7 @@
 #  You may distribute under the terms of either the GNU General Public License
 #  or the Artistic License (the same terms as Perl itself)
 #
-#  (C) Paul Evans, 2009,2010 -- leonerd at leonerd.org.uk
+#  (C) Paul Evans, 2009-2011 -- leonerd at leonerd.org.uk
 
 package Convert::Color::VGA;
 
@@ -13,7 +13,7 @@
 
 use Carp;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 =head1 NAME
 
@@ -42,12 +42,12 @@
 basic VGA colors. Their names are
 
  black
+ red
+ green
+ yellow
  blue
- green
+ magenta
  cyan
- red
- magenta
- yellow
  white
 
 They may be looked up either by name, or by numerical index within this list.
@@ -56,18 +56,18 @@
 
 my %vga_colors = (
    black   => [ 0, 0, 0 ],
+   red     => [ 1, 0, 0 ],
+   green   => [ 0, 1, 0 ],
+   yellow  => [ 1, 1, 0 ],
    blue    => [ 0, 0, 1 ],
-   green   => [ 0, 1, 0 ],
+   magenta => [ 1, 0, 1 ],
    cyan    => [ 0, 1, 1 ],
-   red     => [ 1, 0, 0 ],
-   magenta => [ 1, 0, 1 ],
-   yellow  => [ 1, 1, 0 ],
    white   => [ 1, 1, 1 ],
 );
 
 # Also indexes
 my @vga_colors = qw(
-   black blue green cyan red magenta yellow white
+   black red green yellow blue magenta cyan white
 );
 
 __PACKAGE__->register_palette(
@@ -150,11 +150,6 @@
    return $vga_colors[$self->index];
 }
 
-# Keep perl happy; keep Britain tidy
-1;
-
-__END__
-
 =head1 SEE ALSO
 
 =over 4
@@ -168,3 +163,7 @@
 =head1 AUTHOR
 
 Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;

Modified: branches/upstream/libconvert-color-perl/current/lib/Convert/Color/X11.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/lib/Convert/Color/X11.pm?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/lib/Convert/Color/X11.pm (original)
+++ branches/upstream/libconvert-color-perl/current/lib/Convert/Color/X11.pm Sat Apr 30 12:43:05 2011
@@ -1,7 +1,7 @@
 #  You may distribute under the terms of either the GNU General Public License
 #  or the Artistic License (the same terms as Perl itself)
 #
-#  (C) Paul Evans, 2009,2010 -- leonerd at leonerd.org.uk
+#  (C) Paul Evans, 2009-2011 -- leonerd at leonerd.org.uk
 
 package Convert::Color::X11;
 
@@ -13,7 +13,7 @@
 
 use Carp;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 # Different systems put it in different places. We'll try all of them taking
 # the first we find
@@ -84,8 +84,8 @@
 
 =head2 @colors = Convert::Color::X11->colors
 
-Returns a list of the defined color names. This is a list of hash keys, so is
-returned in no particular order.
+Returns a list of the defined color names, in the order they were found in the
+F<rgb.txt> file.
 
 =head2 $num_colors = Convert::Color::X11->colors
 
@@ -159,11 +159,6 @@
    return $self->[3];
 }
 
-# Keep perl happy; keep Britain tidy
-1;
-
-__END__
-
 =head1 SEE ALSO
 
 =over 4
@@ -177,3 +172,7 @@
 =head1 AUTHOR
 
 Paul Evans <leonerd at leonerd.org.uk>
+
+=cut
+
+0x55AA;

Modified: branches/upstream/libconvert-color-perl/current/t/30vga.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/t/30vga.t?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/t/30vga.t (original)
+++ branches/upstream/libconvert-color-perl/current/t/30vga.t Sat Apr 30 12:43:05 2011
@@ -13,7 +13,7 @@
 is( $red->blue,  0, 'red blue' );
 
 is( $red->name,  "red", 'red name' );
-is( $red->index, 4,     'red index' );
+is( $red->index, 1,     'red index' );
 
 is_deeply( [ $red->as_rgb8->rgb8 ], [ 255, 0, 0 ], 'red as_rgb8' );
 
@@ -37,4 +37,4 @@
 my $best_red = $darkred->as_vga;
 
 is( $best_red->name,  "red", 'best red name' );
-is( $best_red->index, 4,     'best red index' );
+is( $best_red->index, 1,     'best red index' );

Modified: branches/upstream/libconvert-color-perl/current/t/31x11.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconvert-color-perl/current/t/31x11.t?rev=73847&op=diff
==============================================================================
--- branches/upstream/libconvert-color-perl/current/t/31x11.t (original)
+++ branches/upstream/libconvert-color-perl/current/t/31x11.t Sat Apr 30 12:43:05 2011
@@ -6,7 +6,7 @@
 require Test::More;
 
 if( eval { Convert::Color::X11->colors; 1 } ) {
-   import Test::More tests => 11;
+   import Test::More tests => 12;
 }
 else {
    import Test::More skip_all => "Cannot load X11 rgb.txt database";
@@ -34,4 +34,9 @@
 
 my $white = Convert::Color::RGB8->new( 255, 255, 255 )->as_x11;
 
-is( $white->name, "white", 'white from RGB8 name' );
+# It's not quite guaranteed that this is "white", as some rgb.txt files might
+# contain other names with the same value, such as "Gray100"
+#   https://rt.cpan.org/Ticket/Display.html?id=66544
+
+isa_ok( $white, "Convert::Color::X11", '$white' );
+is_deeply( [ $white->as_rgb8->rgb8 ], [ 255, 255, 255 ], 'white as_rgb8' );




More information about the Pkg-perl-cvs-commits mailing list