Convert colortriples to hexstrings.
(self, args)
| 2780 | return self.screen._colorstr(args) |
| 2781 | |
| 2782 | def _cc(self, args): |
| 2783 | """Convert colortriples to hexstrings. |
| 2784 | """ |
| 2785 | if isinstance(args, str): |
| 2786 | return args |
| 2787 | try: |
| 2788 | r, g, b = args |
| 2789 | except (TypeError, ValueError): |
| 2790 | raise TurtleGraphicsError("bad color arguments: %s" % str(args)) |
| 2791 | if self.screen._colormode == 1.0: |
| 2792 | r, g, b = [round(255.0*x) for x in (r, g, b)] |
| 2793 | if not ((0 <= r <= 255) and (0 <= g <= 255) and (0 <= b <= 255)): |
| 2794 | raise TurtleGraphicsError("bad color sequence: %s" % str(args)) |
| 2795 | return "#%02x%02x%02x" % (r, g, b) |
| 2796 | |
| 2797 | def teleport(self, x=None, y=None, *, fill_gap: bool = False) -> None: |
| 2798 | """Instantly move turtle to an absolute position. |
no test coverage detected