| @@ 1680-1687 (lines=8) @@ | ||
| 1677 | ||
| 1678 | ||
| 1679 | // make sure a color's components don't go out of bounds |
|
| 1680 | protected function fixColor($c) { |
|
| 1681 | foreach (range(1, 3) as $i) { |
|
| 1682 | if ($c[$i] < 0) $c[$i] = 0; |
|
| 1683 | if ($c[$i] > 255) $c[$i] = 255; |
|
| 1684 | } |
|
| 1685 | ||
| 1686 | return $c; |
|
| 1687 | } |
|
| 1688 | ||
| 1689 | protected function op_number_color($op, $lft, $rgt) { |
|
| 1690 | if ($op == '+' || $op == '*') { |
|
| @@ 1731-1738 (lines=8) @@ | ||
| 1728 | } |
|
| 1729 | ||
| 1730 | // make sure a color's components don't go out of bounds |
|
| 1731 | protected function fixColor($c) { |
|
| 1732 | foreach (range(1, 3) as $i) { |
|
| 1733 | if ($c[$i] < 0) $c[$i] = 0; |
|
| 1734 | if ($c[$i] > 255) $c[$i] = 255; |
|
| 1735 | } |
|
| 1736 | ||
| 1737 | return $c; |
|
| 1738 | } |
|
| 1739 | ||
| 1740 | public function toHSL($red, $green, $blue) { |
|
| 1741 | $r = $red / 255; |
|