Code Duplication    Length = 14-15 lines in 2 locations

lib/Ajde/Document/Processor/Css/lib/maximizer/inc/ColorSpace.php 2 locations

@@ 610-624 (lines=15) @@
607
        return ['X' => $r['X'] * $X, 'Y' => $r['Y'] * $Y, $Z => $r['Z'] * $Z];
608
    }
609
610
    public function Lab_LCHab($o)
611
    {
612
        $H = atan2($o['b'], $o['a']) * (180 / PI);
613
614
        if ($H < 0) {
615
            $H += 360;
616
        } else {
617
            if ($H > 360) {
618
                $H -= 360;
619
            }
620
        }
621
622
        return ['L' => $o['L'], 'C' => sqrt($o['a'] * $o['a'] + $o['b'] * $o['b']), 'H' => $H];
623
    }
624
625
    // CIE-L*uv (1976) = L: Luminescence / u: Saturation / v: Hue
626
627
    public function Luv_XYZ($o)
@@ 646-659 (lines=14) @@
643
        return ['X' => $X, 'Y' => $Y, 'Z' => $Z];
644
    }
645
646
    public function Luv_LCHuv($o)
647
    {
648
        $H = atan2($o['v'], $o['u']) * (180 / PI);
649
650
        if ($H < 0) {
651
            $H += 360;
652
        } else {
653
            if ($H > 360) {
654
                $H -= 360;
655
            }
656
        }
657
658
        return ['L' => $o['L'], 'C' => sqrt($o['u'] * $o['u'] + $o['v'] * $o['v']), 'H' => $H];
659
    }
660
661
    // CIE-L*CH (1986) = L: Luminescece / C: Chromacity / H: Hue
662