projects
/
convert-color-husl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f72b05
)
Set h to 0 when C is very small
author
Marius Gavrilescu
<marius@ieval.ro>
Wed, 17 Jun 2015 13:04:53 +0000
(16:04 +0300)
committer
Marius Gavrilescu
<marius@ieval.ro>
Wed, 17 Jun 2015 13:04:53 +0000
(16:04 +0300)
lib/Convert/Color/LCh.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Convert/Color/LCh.pm
b/lib/Convert/Color/LCh.pm
index 83cf1bf6fa0945ec1fb50385cd05c08b279821cd..3632729c461f14923bc7d12826f4d5fa2c624f05 100644
(file)
--- a/
lib/Convert/Color/LCh.pm
+++ b/
lib/Convert/Color/LCh.pm
@@
-37,6
+37,7
@@
sub new_from_luv {
my ($class, $luv) = @_;
my ($l, $u, $v) = @$luv;
my $c = sqrt $u * $u + $v * $v;
+ return $class->new($l, $c, 0) if $c < 0.00000001;
my $hrad = atan2 $v, $u;
my $h = $hrad * 180 / pi;
$h += 360 if $h < 0;
This page took
0.009885 seconds
and
4
git commands to generate.