| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public static function interpretColor($value, Color $default): Color |
||
| 18 | { |
||
| 19 | // color as RGB |
||
| 20 | if (is_array($value)) { |
||
| 21 | return Color::newFromArray($value); |
||
| 22 | } |
||
| 23 | // color as CSS hex definition |
||
| 24 | if (is_string($value)) { |
||
| 25 | return Color::newFromString($value); |
||
| 26 | } |
||
| 27 | return $default; |
||
| 28 | } |
||
| 68 |