根据新版本调整set_pattern:0~65535
This commit is contained in:
@@ -9,9 +9,14 @@ import threading
|
||||
import tkinter as tk
|
||||
from tkinter import filedialog, messagebox
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import ttkbootstrap as ttk
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from app.solid_color_scale import (
|
||||
SOLID_COLOR_MAX,
|
||||
byte_to_solid_color,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pqAutomationApp import PQAutomationApp
|
||||
@@ -196,8 +201,12 @@ def _load_patterns(self: "PQAutomationApp"):
|
||||
continue
|
||||
if r is None or g is None or b is None:
|
||||
continue
|
||||
if min(r, g, b) < 0 or max(r, g, b) > 255:
|
||||
if min(r, g, b) < 0 or max(r, g, b) > SOLID_COLOR_MAX:
|
||||
continue
|
||||
if max(r, g, b) <= 255:
|
||||
r = byte_to_solid_color(r)
|
||||
g = byte_to_solid_color(g)
|
||||
b = byte_to_solid_color(b)
|
||||
patterns.append((r, g, b))
|
||||
finally:
|
||||
wb.close()
|
||||
|
||||
Reference in New Issue
Block a user