]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/commitdiff
Merge pull request #73 from FoamyGuy/palette_items
authorMelissa LeBlanc-Williams <melissa@adafruit.com>
Thu, 2 Dec 2021 16:23:43 +0000 (08:23 -0800)
committerGitHub <noreply@github.com>
Thu, 2 Dec 2021 16:23:43 +0000 (08:23 -0800)
return rgba888 value from palette getitem

.github/workflows/build.yml
displayio/palette.py
displayio/tilegrid.py
docs/conf.py
setup.py

index ac6673b0a9fa0a40f024e39ad8a2f24574cb09c8..46cefce5c3af5f02b9851d38536c2fc5bee7cdb7 100644 (file)
@@ -19,10 +19,10 @@ jobs:
       id: repo-name
       run: |
         echo ::set-output name=repo-name::Adafruit-Blinka-displayio
-    - name: Set up Python 3.6
+    - name: Set up Python 3.7
       uses: actions/setup-python@v1
       with:
-        python-version: 3.6
+        python-version: 3.7
     - name: Versions
       run: |
         python3 --version
index 77e78a5aab34010f5bf3264853123e030826c1bd..cda3b705200378ca24fe1f542f8204514a20eb67 100644 (file)
@@ -82,7 +82,7 @@ class Palette:
     def __getitem__(self, index):
         if not 0 <= index < len(self._colors):
             raise ValueError("Palette index out of range")
-        return self._colors[index]
+        return self._colors[index]["rgb888"]
 
     def make_transparent(self, palette_index):
         """Set the palette index to be a transparent color"""
index 8532ac5ece0055ee7dfe9426d516393592938d28..e2a4653b81cf7ccb4aa7b813b20b35c995fb8368 100644 (file)
@@ -179,7 +179,7 @@ class TileGrid:
 
     def _shade(self, pixel_value):
         if isinstance(self._pixel_shader, Palette):
-            return self._pixel_shader[pixel_value]["rgba"]
+            return self._pixel_shader[pixel_value]
         if isinstance(self._pixel_shader, ColorConverter):
             return self._pixel_shader.convert(pixel_value)
         return pixel_value
index 02e8c13767bcbda9f5bf672baf042f3aaf881c69..44577df0436ba435de6cfd3d1a69875eb489a131 100644 (file)
@@ -28,7 +28,7 @@ extensions = [
 # autodoc_mock_imports = ["digitalio", "busio"]
 
 intersphinx_mapping = {
-    "python": ("https://docs.python.org/3.4", None),
+    "python": ("https://docs.python.org/3.7", None),
     "CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
 }
 
index 88d1a43365e4076ba3b6c632b3b9195ebcd5479d..5e2a025318fc13a5b64fa950d403d303b43a704d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -49,8 +49,7 @@ setup(
         "Topic :: System :: Hardware",
         "License :: OSI Approved :: MIT License",
         "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.4",
-        "Programming Language :: Python :: 3.5",
+        "Programming Language :: Python :: 3.7",
     ],
     # What does your project relate to?
     keywords="adafruit blinka circuitpython micropython displayio lcd tft display pitft",