Code Duplication    Length = 20-21 lines in 2 locations

lib/Ajde/Document/Processor/Css/lib/maximizer/inc/ColorSpace.php 1 location

@@ 362-382 (lines=21) @@
359
360
    // HSL (1978) = H: Hue / S: Saturation / L: Lightess
361
362
    public function Hue_2_RGB($v1, $v2, $vH)
363
    {
364
        if ($vH < 0) {
365
            $vH += 1;
366
        }
367
        if ($vH > 1) {
368
            $vH -= 1;
369
        }
370
        if ((6 * $vH) < 1) {
371
            return $v1 + ($v2 - $v1) * 6 * $vH;
372
        }
373
        if ((2 * $vH) < 1) {
374
            return $v2;
375
        }
376
        if ((3 * $vH) < 2) {
377
            return $v1 + ($v2 - $v1) * ((2 / 3) - $vH) * 6;
378
        }
379
380
        return $v1;
381
    }
382
383
    public function HSL_RGB($o)
384
    {
385
        $H = $o['H'] / 360;

lib/Ajde/Resource/Local/Compressor/lib/Cssmin.php 1 location

@@ 3524-3543 (lines=20) @@
3521
     *
3522
     * @return int
3523
     */
3524
    private function hue2rgb($v1, $v2, $hue)
3525
    {
3526
        if ($hue < 0) {
3527
            $hue += 1;
3528
        }
3529
        if ($hue > 1) {
3530
            $hue -= 1;
3531
        }
3532
        if ((6 * $hue) < 1) {
3533
            return $v1 + ($v2 - $v1) * 6 * $hue;
3534
        }
3535
        if ((2 * $hue) < 1) {
3536
            return $v2;
3537
        }
3538
        if ((3 * $hue) < 2) {
3539
            return $v1 + ($v2 - $v1) * ((2 / 3) - $hue) * 6;
3540
        }
3541
3542
        return $v1;
3543
    }
3544
}
3545
3546
/**