From 8f941c072088954b142be7e7c293607a8015aa57 Mon Sep 17 00:00:00 2001 From: Bernhard Bablok Date: Tue, 15 Apr 2025 16:47:49 +0200 Subject: [PATCH] make internal _color_index one-based again --- vectorio/_rectangle.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vectorio/_rectangle.py b/vectorio/_rectangle.py index f8c8d82..15880c6 100644 --- a/vectorio/_rectangle.py +++ b/vectorio/_rectangle.py @@ -52,7 +52,7 @@ class Rectangle(_VectorShape): """ self._width = 1 self._height = 1 - self._color_index = color_index + self._color_index = color_index + 1 super().__init__(pixel_shader, x, y) self.width = width @@ -86,11 +86,11 @@ class Rectangle(_VectorShape): @property def color_index(self) -> int: """The color_index of the rectangle as 0 based index of the palette.""" - return self._color_index + return self._color_index - 1 @color_index.setter def color_index(self, value: int) -> None: - self._color_index = abs(value) + self._color_index = abs(value + 1) self._shape_set_dirty() def _get_pixel(self, x: int, y: int) -> int: -- 2.49.0