Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package perl-Graphics-Toolkit-Color for
openSUSE:Factory checked in at 2023-01-31 16:09:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Graphics-Toolkit-Color (Old)
and /work/SRC/openSUSE:Factory/.perl-Graphics-Toolkit-Color.new.32243
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Graphics-Toolkit-Color"
Tue Jan 31 16:09:59 2023 rev:3 rq:1062197 version:1.08
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Graphics-Toolkit-Color/perl-Graphics-Toolkit-Color.changes
2023-01-04 17:55:07.743075036 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Graphics-Toolkit-Color.new.32243/perl-Graphics-Toolkit-Color.changes
2023-01-31 16:16:33.532311522 +0100
@@ -1,0 +2,21 @@
+Wed Jan 25 03:06:56 UTC 2023 - Tina Müller <[email protected]>
+
+- updated to 1.08
+ see /usr/share/doc/packages/perl-Graphics-Toolkit-Color/Changes
+
+ 1.08 2023-01-24 lichtkind
+ -------
+ * = small enhancements
+ * + added method rgb_gradient_to
+ * ~ changed gradient_to to hsl_gradient_to (but keeping compatibility)
+ * ? even more POD fixes
+ 1.07 2023-01-20 lichtkind
+ -------
+ * = POD fixes
+ 1.06 2023-01-20 lichtkind
+ -------
+ * = maintenance release
+ * + simplified string serialisation method (->new(eval $string) =>
->new($string))
+ * ? small POD fixes
+
+-------------------------------------------------------------------
Old:
----
Graphics-Toolkit-Color-1.05.tar.gz
New:
----
Graphics-Toolkit-Color-1.08.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Graphics-Toolkit-Color.spec ++++++
--- /var/tmp/diff_new_pack.fi0XfO/_old 2023-01-31 16:16:33.964314025 +0100
+++ /var/tmp/diff_new_pack.fi0XfO/_new 2023-01-31 16:16:33.968314048 +0100
@@ -18,7 +18,7 @@
%define cpan_name Graphics-Toolkit-Color
Name: perl-Graphics-Toolkit-Color
-Version: 1.05
+Version: 1.08
Release: 0
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Color palette creation helper
@@ -35,12 +35,15 @@
%{perl_requires}
%description
-Each object has 7 attributes, which are its RGB and HSL values and if
-possible a name. This is because humans access colors on hardware level
-(eye) in RGB, on cognition level in HSL (brain) and on cultural level
-(language) with names. Having easy access to all three and some color math
-should enable you to get the color palette you desire quickly and with no
-additional dependencies.
+Read only color holding objects with no additional dependencies. Create
+them in many different ways (see section _CONSTRUCTOR_). Access its values
+via methods from section _GETTER_ or create related color objects via
+methods listed under _METHODS_.
+
+Humans access colors on hardware level (eye) in RGB, on cognition level in
+HSL (brain) and on cultural level (language) with names. Having easy access
+to all three and some color math should enable you to get the color palette
+you desire quickly.
%prep
%autosetup -n %{cpan_name}-%{version}
++++++ Graphics-Toolkit-Color-1.05.tar.gz -> Graphics-Toolkit-Color-1.08.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Graphics-Toolkit-Color-1.05/Changes
new/Graphics-Toolkit-Color-1.08/Changes
--- old/Graphics-Toolkit-Color-1.05/Changes 2022-12-31 18:01:58.000000000
+0100
+++ new/Graphics-Toolkit-Color-1.08/Changes 2023-01-24 23:16:08.000000000
+0100
@@ -1,13 +1,31 @@
+1.08 2023-01-24 lichtkind
+-------
+ * = small enhancements
+ * + added method rgb_gradient_to
+ * ~ changed gradient_to to hsl_gradient_to (but keeping compatibility)
+ * ? even more POD fixes
+
+1.07 2023-01-20 lichtkind
+-------
+ * = POD fixes
+
+1.06 2023-01-20 lichtkind
+
+-------
+ * = maintenance release
+ * + simplified string serialisation method (->new(eval $string) =>
->new($string))
+ * ? small POD fixes
+
1.05 2022-12-31 lichtkind
-------
- * = fixes
+ * = small enhancements
* + added getters for data hashes
* ? cleaned some sentences and comments
* ? synopsis cleanup
1.04 2022-11-04 lichtkind
-------
- * = fixes
+ * = small fixes
* & fixing meta files
* ? typos
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Graphics-Toolkit-Color-1.05/META.json
new/Graphics-Toolkit-Color-1.08/META.json
--- old/Graphics-Toolkit-Color-1.05/META.json 2022-12-31 18:01:58.000000000
+0100
+++ new/Graphics-Toolkit-Color-1.08/META.json 2023-01-24 23:16:08.000000000
+0100
@@ -49,15 +49,15 @@
"provides" : {
"Graphics::Toolkit::Color" : {
"file" : "lib/Graphics/Toolkit/Color.pm",
- "version" : "1.05"
+ "version" : "1.08"
},
"Graphics::Toolkit::Color::Constant" : {
"file" : "lib/Graphics/Toolkit/Color/Constant.pm",
- "version" : "1.05"
+ "version" : "1.08"
},
"Graphics::Toolkit::Color::Value" : {
"file" : "lib/Graphics/Toolkit/Color/Value.pm",
- "version" : "1.05"
+ "version" : "1.08"
}
},
"release_status" : "stable",
@@ -68,7 +68,7 @@
"web" : "https://github.com/lichtkind/Graphics-Color-Toolkit"
}
},
- "version" : "1.05",
+ "version" : "1.08",
"x_generated_by_perl" : "v5.30.0",
"x_serialization_backend" : "Cpanel::JSON::XS version 4.19",
"x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Graphics-Toolkit-Color-1.05/META.yml
new/Graphics-Toolkit-Color-1.08/META.yml
--- old/Graphics-Toolkit-Color-1.05/META.yml 2022-12-31 18:01:58.000000000
+0100
+++ new/Graphics-Toolkit-Color-1.08/META.yml 2023-01-24 23:16:08.000000000
+0100
@@ -20,20 +20,20 @@
provides:
Graphics::Toolkit::Color:
file: lib/Graphics/Toolkit/Color.pm
- version: '1.05'
+ version: '1.08'
Graphics::Toolkit::Color::Constant:
file: lib/Graphics/Toolkit/Color/Constant.pm
- version: '1.05'
+ version: '1.08'
Graphics::Toolkit::Color::Value:
file: lib/Graphics/Toolkit/Color/Value.pm
- version: '1.05'
+ version: '1.08'
requires:
Carp: '1.35'
Exporter: '5'
perl: v5.12.0
resources:
repository: git://github.com/lichtkind/Graphics-Color-Toolkit.git
-version: '1.05'
+version: '1.08'
x_generated_by_perl: v5.30.0
x_serialization_backend: 'YAML::Tiny version 1.73'
x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Graphics-Toolkit-Color-1.05/Makefile.PL
new/Graphics-Toolkit-Color-1.08/Makefile.PL
--- old/Graphics-Toolkit-Color-1.05/Makefile.PL 2022-12-31 18:01:58.000000000
+0100
+++ new/Graphics-Toolkit-Color-1.08/Makefile.PL 2023-01-24 23:16:08.000000000
+0100
@@ -24,7 +24,7 @@
"Test::More" => "1.3",
"Test::Warn" => "0.30"
},
- "VERSION" => "1.05",
+ "VERSION" => "1.08",
"test" => {
"TESTS" => "t/*.t"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Graphics-Toolkit-Color-1.05/README
new/Graphics-Toolkit-Color-1.08/README
--- old/Graphics-Toolkit-Color-1.05/README 2022-12-31 18:01:58.000000000
+0100
+++ new/Graphics-Toolkit-Color-1.08/README 2023-01-24 23:16:08.000000000
+0100
@@ -6,16 +6,19 @@
say $red->add('blue')->name; # mix in RGB: 'magenta'
Graphics::Toolkit::Color->new( 0, 0, 255)->hsl; # 240, 100, 50 = blue
$blue->blend_with({H=> 0, S=> 0, L=> 80}, 0.1); # mix blue with a
little grey in HSL
- $red->gradient_to( '#0000FF', 10); # 10 colors from red
to blue
+ $red->rgb_gradient_to( '#0000FF', 10); # 10 colors from red
to blue
$red->complementary( 3 ); # get fitting red
green and blue
DESCRIPTION
- Each object has 7 attributes, which are its RGB and HSL values and if
- possible a name. This is because humans access colors on hardware level
- (eye) in RGB, on cognition level in HSL (brain) and on cultural level
- (language) with names. Having easy access to all three and some color
- math should enable you to get the color palette you desire quickly and
- with no additional dependencies.
+ Read only color holding objects with no additional dependencies. Create
+ them in many different ways (see section *CONSTRUCTOR*). Access its
+ values via methods from section *GETTER* or create related color objects
+ via methods listed under *METHODS*.
+
+ Humans access colors on hardware level (eye) in RGB, on cognition level
+ in HSL (brain) and on cultural level (language) with names. Having easy
+ access to all three and some color math should enable you to get the
+ color palette you desire quickly.
CONSTRUCTOR
There are many options to create a color objects. In short you can
@@ -89,51 +92,39 @@
my $darkblue = color([20, 20, 250]);
GETTER / ATTRIBUTES
- are all read only methods - giving access to different parts of the
- objects data.
+ are read only methods - giving access to different parts of the objects
+ data.
name
- Name of the color in the X11 or HTML (SVG) standard or the Pantone
- report. The name will be found and filled in, even when the object is
- created with RGB or HSL values. If the color is not found in any of the
- mentioned standards, it returns an empty string. All names are at:
- "NAMES" in Graphics::Toolkit::Color::Constant
+ String with name of the color in the X11 or HTML (SVG) standard or the
+ Pantone report. The name will be found and filled in, even when the
+ object is created with RGB or HSL values. If the color is not found in
+ any of the mentioned standards, it returns an empty string. All names
+ are at: "NAMES" in Graphics::Toolkit::Color::Constant
string
- String to reproduce (serialize) color object by:
- Graphics::Toolkit::Color->new (eval $string). It is either the name (if
- color has one) or the stringified triplet: "[ $red, $green, $blue ]".
+ String that can be serialized back into a color object (recreated by
+ Graphics::Toolkit::Color->new( $string )). It is either the color "name"
+ (if color has one) or result of "rgb_hex".
red
- Integer between 0 .. 255 describing the red portion in RGB space.
+ Integer between 0 .. 255 describing the red portion in RGB space. Higher
+ value means more color and an lighter color.
green
Integer between 0 .. 255 describing the green portion in RGB space.
+ Higher value means more color and an lighter color.
blue
Integer between 0 .. 255 describing the blue portion in RGB space.
-
- rgb
- Three values of red, green and blue (see above).
-
- rgb_hex
- String starting with '#', followed by six hexadecimal figures. Two
- digits for each of red, green and blue value - the format used in CSS.
-
- rgb_hash
- Reference to a *HASH* containing the keys 'red', 'green' and 'blue' with
- their respective values as defined above.
-
- hsl_hash
- Reference to a *HASH* containing the keys 'hue', 'saturation' and
- 'lightness' with their respective values as defined below.
+ Higher value means more color and an lighter color.
hue
Integer between 0 .. 359 describing the angle (in degrees) of the
circular dimension in HSL space named hue. 0 approximates red, 30 -
orange, 60 - yellow, 120 - green, 180 - cyan, 240 - blue, 270 - violet,
- 300 - magenta, 330 - pink. 0 and 360 point to the same coordinate, but
- this module only deals with 0.
+ 300 - magenta, 330 - pink. 0 and 360 point to the same coordinate. This
+ module only outputs 0, even if accepting 360 as input.
saturation
Integer between 0 .. 100 describing percentage of saturation in HSL
@@ -143,10 +134,27 @@
lightness
Integer between 0 .. 100 describing percentage of lightness in HSL
space. 0 is always black, 100 is always white and 50 the most colorful
- (depending on hue value) (or grey - if saturation = 0).
+ (depending on "hue" value) (or grey - if saturation = 0).
+
+ rgb
+ List (no *ARRAY* reference) with values of "red", "green" and "blue".
hsl
- Three values of hue, saturation and lightness (see above).
+ List (no *ARRAY* reference) with values of "hue", "saturation" and
+ "lightness".
+
+ rgb_hex
+ String starting with character '#', followed by six hexadecimal lower
+ case figures. Two digits for each of "red", "green" and "blue" value -
+ the format used in CSS (#rrggbb).
+
+ rgb_hash
+ Reference to a *HASH* containing the keys 'red', 'green' and 'blue' with
+ their respective values as defined above.
+
+ hsl_hash
+ Reference to a *HASH* containing the keys 'hue', 'saturation' and
+ 'lightness' with their respective values as defined above.
METHODS
create new, related color (objects) or compute similarity of colors
@@ -207,13 +215,13 @@
$color->blend_with( [192, 192, 192] ); # still same
my $difference = $color->blend_with( $c2, -1 );
- gradient_to
+ rgb_gradient_to
Creates a gradient (a list of colors that build a transition) between
current (C1) and a second, given color (C2).
The first argument is C2. Either as an Graphics::Toolkit::Color object
- or a scalar (name, hex or reference), which is acceptable to the method
- new.
+ or a scalar (name, hex or reference), which is acceptable to a
+ constructor.
Second argument is the number $n of colors, which make up the gradient
(including C1 and C2). It defaults to 3. These 3 colors C1, C2 and a
@@ -221,16 +229,19 @@
Third argument is also a positive number $p, which defaults to one. It
defines the dynamics of the transition between the two colors. If $p ==
- 1 you get a linear transition - meaning the distance in HSL space
- (distance_hsl) is equal from one color to the next. If $p != 1, the
- formula $n ** $p starts to create a parabola function, which defines a
- none linear mapping. For values $n > 1 the transition starts by sticking
- to C1 and slowly getting faster and faster toward C2. Values $n < 1 do
- the opposite: starting by moving fastest from C1 to C2 (big distances)
- and becoming slower and slower.
+ 1 you get a linear transition - meaning the distance in RGB space is
+ equal from one color to the next. If $p != 1, the formula $n ** $p
+ starts to create a parabola function, which defines a none linear
+ mapping. For values $n > 1 the transition starts by sticking to C1 and
+ slowly getting faster and faster toward C2. Values $n < 1 do the
+ opposite: starting by moving fastest from C1 to C2 (big distances) and
+ becoming slower and slower.
+
+ my @colors = $c->rgb_gradient_to( $grey, 5 ); # we turn to grey
+ @colors = $c1->rgb_gradient_to( [14,10,222], 10, 3 ); # none linear
gradient
- my @colors = $c->gradient_to( $grey, 5 ); # we turn to grey
- @colors = $c1->gradient_to( [14,10,222], 10, 3 ); # none linear
gradient
+ hsl_gradient_to
+ Same as "rgb_gradient_to" (what you normally want), but in HSL space.
complementary
Creates a set of complementary colors. It accepts 3 numerical arguments:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Graphics-Toolkit-Color-1.05/lib/Graphics/Toolkit/Color.pm
new/Graphics-Toolkit-Color-1.08/lib/Graphics/Toolkit/Color.pm
--- old/Graphics-Toolkit-Color-1.05/lib/Graphics/Toolkit/Color.pm
2022-12-31 18:01:58.000000000 +0100
+++ new/Graphics-Toolkit-Color-1.08/lib/Graphics/Toolkit/Color.pm
2023-01-24 23:16:08.000000000 +0100
@@ -4,7 +4,7 @@
use v5.12;
package Graphics::Toolkit::Color;
-our $VERSION = '1.05';
+our $VERSION = '1.08';
use Carp;
use Graphics::Toolkit::Color::Constant ':all';
@@ -93,7 +93,7 @@
sub hue { $_[0][4] }
sub saturation { $_[0][5] }
sub lightness { $_[0][6] }
-sub string { $_[0][0] ? $_[0][0] : "[ $_[0][1], $_[0][2], $_[0][3] ]" }
+sub string { $_[0][0] ? $_[0][0] : $_[0]->rgb_hex }
sub rgb { @{$_[0]}[1 .. 3] }
sub hsl { @{$_[0]}[4 .. 6] }
@@ -195,8 +195,10 @@
new( __PACKAGE__, { H => $hsl[0], S => $hsl[1], L => $hsl[2] });
}
+# for compatibility
+sub gradient_to { hsl_gradient_to( @_ ) }
-sub gradient_to {
+sub hsl_gradient_to {
my ($self, $c2, $steps, $power) = @_;
return carp "need color object or definition as first argument" unless
defined $c2;
$c2 = (ref $c2 eq __PACKAGE__) ? $c2 : _new_from_scalar( $c2 );
@@ -221,6 +223,27 @@
$self, @colors, $c2;
}
+sub rgb_gradient_to {
+ my ($self, $c2, $steps, $power) = @_;
+ return carp "need color object or definition as first argument" unless
defined $c2;
+ $c2 = (ref $c2 eq __PACKAGE__) ? $c2 : _new_from_scalar( $c2 );
+ return unless ref $c2 eq __PACKAGE__;
+ $steps //= 3;
+ $power //= 1;
+ return carp "third argument (dynamics), has to be positive (>= 0)" if
$power <= 0;
+ return $self if $steps == 1;
+ my @colors = ();
+ my @delta_rgb = ($c2->red - $self->red, $c2->green - $self->green,
$c2->blue - $self->blue );
+ for my $i (1 .. $steps-2){
+ my $pos = ($i / ($steps-1)) ** $power;
+ my @rgb = ( $self->red + ($pos * $delta_rgb[0]),
+ $self->green + ($pos * $delta_rgb[1]),
+ $self->blue + ($pos * $delta_rgb[2]));
+ push @colors, new( __PACKAGE__, @rgb);
+ }
+ $self, @colors, $c2;
+}
+
sub complementary {
my ($self) = shift;
my ($count) = int ((shift // 1) + 0.5);
@@ -266,16 +289,22 @@
say $red->add('blue')->name; # mix in RGB: 'magenta'
Graphics::Toolkit::Color->new( 0, 0, 255)->hsl; # 240, 100, 50 = blue
$blue->blend_with({H=> 0, S=> 0, L=> 80}, 0.1); # mix blue with a little
grey in HSL
- $red->gradient_to( '#0000FF', 10); # 10 colors from red to
blue
+ $red->rgb_gradient_to( '#0000FF', 10); # 10 colors from red to
blue
$red->complementary( 3 ); # get fitting red green
and blue
+
=head1 DESCRIPTION
-Each object has 7 attributes, which are its RGB and HSL values and if possible
a name.
-This is because humans access colors on hardware level (eye) in RGB,
-on cognition level in HSL (brain) and on cultural level (language) with names.
+Read only color holding objects with no additional dependencies.
+Create them in many different ways (see section I<CONSTRUCTOR>).
+Access its values via methods from section I<GETTER> or create related
+color objects via methods listed under I<METHODS>.
+
+Humans access colors on hardware level (eye) in RGB, on cognition level
+in HSL (brain) and on cultural level (language) with names.
Having easy access to all three and some color math should enable you to get
the color
-palette you desire quickly and with no additional dependencies.
+palette you desire quickly.
+
=head1 CONSTRUCTOR
@@ -363,54 +392,37 @@
=head1 GETTER / ATTRIBUTES
-are all read only methods - giving access to different parts of the
+are read only methods - giving access to different parts of the
objects data.
=head2 name
-Name of the color in the X11 or HTML (SVG) standard or the Pantone report.
-The name will be found and filled in, even when the object is created
-with RGB or HSL values. If the color is not found in any of the mentioned
-standards, it returns an empty string. All names are
-at: L<Graphics::Toolkit::Color::Constant/NAMES>
+String with name of the color in the X11 or HTML (SVG) standard or the
+Pantone report. The name will be found and filled in, even when the object
+is created with RGB or HSL values. If the color is not found in any of
+the mentioned standards, it returns an empty string. All names are at:
+L<Graphics::Toolkit::Color::Constant/NAMES>
=head2 string
-String to reproduce (serialize) color object by:
-Graphics::Toolkit::Color->new (eval $string).
-It is either the name (if color has one) or the stringified triplet:
-"[ $red, $green, $blue ]".
+String that can be serialized back into a color object
+(recreated by Graphics::Toolkit::Color->new( $string )).
+It is either the color L</name> (if color has one) or result of L</rgb_hex>.
=head2 red
Integer between 0 .. 255 describing the red portion in RGB space.
+Higher value means more color and an lighter color.
=head2 green
Integer between 0 .. 255 describing the green portion in RGB space.
+Higher value means more color and an lighter color.
=head2 blue
Integer between 0 .. 255 describing the blue portion in RGB space.
-
-=head2 rgb
-
-Three values of red, green and blue (see above).
-
-=head2 rgb_hex
-
-String starting with '#', followed by six hexadecimal figures.
-Two digits for each of red, green and blue value - the format used in CSS.
-
-=head2 rgb_hash
-
-Reference to a I<HASH> containing the keys C<'red'>, C<'green'> and C<'blue'>
-with their respective values as defined above.
-
-=head2 hsl_hash
-
-Reference to a I<HASH> containing the keys C<'hue'>, C<'saturation'> and
C<'lightness'>
-with their respective values as defined below.
+Higher value means more color and an lighter color.
=head2 hue
@@ -418,7 +430,8 @@
circular dimension in HSL space named hue.
0 approximates red, 30 - orange, 60 - yellow, 120 - green, 180 - cyan,
240 - blue, 270 - violet, 300 - magenta, 330 - pink.
-0 and 360 point to the same coordinate, but this module only deals with 0.
+0 and 360 point to the same coordinate. This module only outputs 0,
+even if accepting 360 as input.
=head2 saturation
@@ -429,11 +442,32 @@
Integer between 0 .. 100 describing percentage of lightness in HSL space.
0 is always black, 100 is always white and 50 the most colorful
-(depending on hue value) (or grey - if saturation = 0).
+(depending on L</hue> value) (or grey - if saturation = 0).
+
+=head2 rgb
+
+List (no I<ARRAY> reference) with values of L</red>, L</green> and L</blue>.
=head2 hsl
-Three values of hue, saturation and lightness (see above).
+List (no I<ARRAY> reference) with values of L</hue>, L</saturation> and
L</lightness>.
+
+=head2 rgb_hex
+
+String starting with character '#', followed by six hexadecimal lower case
figures.
+Two digits for each of L</red>, L</green> and L</blue> value -
+the format used in CSS (#rrggbb).
+
+=head2 rgb_hash
+
+Reference to a I<HASH> containing the keys C<'red'>, C<'green'> and C<'blue'>
+with their respective values as defined above.
+
+=head2 hsl_hash
+
+Reference to a I<HASH> containing the keys C<'hue'>, C<'saturation'> and
C<'lightness'>
+with their respective values as defined above.
+
=head1 METHODS
@@ -496,13 +530,13 @@
my $difference = $color->blend_with( $c2, -1 );
-=head2 gradient_to
+=head2 rgb_gradient_to
Creates a gradient (a list of colors that build a transition) between
current (C1) and a second, given color (C2).
The first argument is C2. Either as an Graphics::Toolkit::Color object or a
-scalar (name, hex or reference), which is acceptable to the method new.
+scalar (name, hex or reference), which is acceptable to a constructor.
Second argument is the number $n of colors, which make up the gradient
(including C1 and C2). It defaults to 3. These 3 colors C1, C2 and a
@@ -510,16 +544,20 @@
Third argument is also a positive number $p, which defaults to one.
It defines the dynamics of the transition between the two colors.
-If $p == 1 you get a linear transition - meaning the distance in HSL
-space (distance_hsl) is equal from one color to the next. If $p != 1,
+If $p == 1 you get a linear transition - meaning the distance in RGB
+space is equal from one color to the next. If $p != 1,
the formula $n ** $p starts to create a parabola function, which defines
a none linear mapping. For values $n > 1 the transition starts by sticking
to C1 and slowly getting faster and faster toward C2. Values $n < 1 do
the opposite: starting by moving fastest from C1 to C2 (big distances)
and becoming slower and slower.
- my @colors = $c->gradient_to( $grey, 5 ); # we turn to grey
- @colors = $c1->gradient_to( [14,10,222], 10, 3 ); # none linear gradient
+ my @colors = $c->rgb_gradient_to( $grey, 5 ); # we turn to grey
+ @colors = $c1->rgb_gradient_to( [14,10,222], 10, 3 ); # none linear
gradient
+
+=head2 hsl_gradient_to
+
+Same as L</rgb_gradient_to> (what you normally want), but in HSL space.
=head2 complementary
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Graphics-Toolkit-Color-1.05/t/03_color.t
new/Graphics-Toolkit-Color-1.08/t/03_color.t
--- old/Graphics-Toolkit-Color-1.05/t/03_color.t 2022-12-31
18:01:58.000000000 +0100
+++ new/Graphics-Toolkit-Color-1.08/t/03_color.t 2023-01-24
23:16:08.000000000 +0100
@@ -54,7 +54,7 @@
is( $red->hsl_hash->{'saturation'}, 100, 'named red has correct saturation
value in hsl HASH');
is( $red->hsl_hash->{'lightness'}, 50, 'named red has correct lightness
value in hsl HASH');
is( $red->string, 'red', 'named red does stringify correctly');
-is( Graphics::Toolkit::Color->new(15,12,13)->string, '[ 15, 12, 13 ]', 'random
color does stringify correctly');
+is( Graphics::Toolkit::Color->new(15,12,13)->string, '#0f0c0d', 'random color
does stringify correctly');
$red = Graphics::Toolkit::Color->new('#FF0000');