(self, color_string: str)
| 476 | return bool(color_string.startswith("#")) |
| 477 | |
| 478 | def _convert_hex_to_excel(self, color_string: str) -> str: |
| 479 | code = color_string.lstrip("#") |
| 480 | if self._is_shorthand_color(color_string): |
| 481 | return (code[0] * 2 + code[1] * 2 + code[2] * 2).upper() |
| 482 | else: |
| 483 | return code.upper() |
| 484 | |
| 485 | def _is_shorthand_color(self, color_string: str) -> bool: |
| 486 | """Check if color code is shorthand. |
no test coverage detected