28 lines
708 B
Python
28 lines
708 B
Python
from typing import Literal
|
|
|
|
from PySide6.QtGui import QColor
|
|
|
|
from aaredaqlib.coordinate import SmargonCoordinate
|
|
|
|
|
|
class SmargonBookmark:
|
|
coord: SmargonCoordinate
|
|
color: Literal[
|
|
"red", "green", "blue", "indigo", "lime"
|
|
] # Restrict to specific colors
|
|
|
|
def qt_color(self) -> QColor:
|
|
"""Convert the color property to a QColor."""
|
|
color_map = {
|
|
"red": QColor("red"),
|
|
"green": QColor("green"),
|
|
"blue": QColor("blue"),
|
|
"indigo": QColor("indigo"),
|
|
"lime": QColor("lime"),
|
|
}
|
|
return color_map[self.color] # Map the color string to QColor
|
|
|
|
|
|
class SmargonBookmarkList:
|
|
b: list[SmargonBookmark]
|