| @@ 1674-1681 (lines=8) @@ | ||
| 1671 | ||
| 1672 | ||
| 1673 | // make sure a color's components don't go out of bounds |
|
| 1674 | protected function fixColor($c) { |
|
| 1675 | foreach (range(1, 3) as $i) { |
|
| 1676 | if ($c[$i] < 0) $c[$i] = 0; |
|
| 1677 | if ($c[$i] > 255) $c[$i] = 255; |
|
| 1678 | } |
|
| 1679 | ||
| 1680 | return $c; |
|
| 1681 | } |
|
| 1682 | ||
| 1683 | protected function op_number_color($op, $lft, $rgt) { |
|
| 1684 | 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; |
|