diff --git a/docs/source/more/customise.rst b/docs/source/more/customise.rst index 8f3d2f60..7b56197a 100644 --- a/docs/source/more/customise.rst +++ b/docs/source/more/customise.rst @@ -59,24 +59,24 @@ A colour theme ``.conf`` file consists of the following settings: licenseurl = https://creativecommons.org/licenses/by-sa/4.0/ [Base] - default = #303030 - faded = #6c6c6c - red = #a62a2d - orange = #b36829 - yellow = #a68542 - green = #296629 - cyan = #269999 - blue = #3a70a6 - purple = #b35ab3 + default = #303030 + faded = #6c6c6c + red = #a62a2d + orange = #b36829 + yellow = #a68542 + green = #296629 + cyan = #269999 + blue = #3a70a6 + purple = #b35ab3 [Project] - root = blue - folder = yellow - file = default - title = green - chapter = red - scene = blue - note = yellow + root = blue + folder = yellow + file = default + title = green + chapter = red + scene = blue + note = yellow [Palette] window = #efefef @@ -95,31 +95,31 @@ A colour theme ``.conf`` file consists of the following settings: linkvisited = blue [GUI] - helptext = #5c5c5c - fadedtext = #6c6c6c - errortext = red + helptext = #5c5c5c + fadedtext = #6c6c6c + errortext = red [Syntax] - background = #ffffff - text = #000000 - link = blue - headertext = green - headertag = green:160 - emphasis = orange - dialog = blue - altdialog = blue - note = yellow - hidden = faded - shortcode = green - keyword = red - tag = green - value = blue - optional = green - spellcheckline = red - errorline = green - replacetag = green - modifier = green - texthighlight = #c8c80060 + background = #ffffff + text = #000000 + link = blue + headertext = green + headertag = green:L135 + emphasis = orange + dialog = blue + altdialog = blue + note = yellow + hidden = faded + shortcode = green + keyword = red + tag = green + value = blue + optional = green + spellcheckline = red + errorline = green + replacetag = green + modifier = green + texthighlight = #c8c80060 Theme Sections @@ -149,12 +149,15 @@ There are several ways to enter colour values: .. csv-table:: Colour Formats :header: "Syntax", "Description" + :widths: 15, 85 :class: "tight-table" "``#RRGGBB``", "A CSS style hexadecimal values, like ``#ff0000`` for red." "``#RRGGBBAA``", "A CSS style hexadecimal values with transparency, like ``#ff00007f`` for half-transparent red." "``name``", "A name referring to one of the colours already specified under the ``[Base]`` section, like ``red``. Note that you should not use named colours in the ``[Base]`` section itself as that may have unintended results." - "``name:alpha``", "A name referring to one of the colours already specified under the ``[Base]`` section, with a transparency value added. The alpha value must be in the range ``0`` to ``255``, like ``red:127`` for half-transparent red." + "``name:255``", "A name referring to one of the colours already specified under the ``[Base]`` section, with a transparency value added. The value must be in the range ``0`` to ``255``, like ``red:127`` for half-transparent red." + "``name:L100``", "A name referring to one of the colours already specified under the ``[Base]`` section, where the L-number is a percentage value that makes it lighter. The value must be greater than ``0``. ``L100`` means no change." + "``name:D100``", "A name referring to one of the colours already specified under the ``[Base]`` section, where the D-number is a percentage value that makes it darker. The value must be greater than ``0``. ``D100`` means no change." "``r, g, b``", "A set of red, green and blue numbers in the range ``0`` to ``255``, like ``255, 0, 0`` for red." "``r, g, b, a``", "A set of red, green, blue and alpha numbers in the range ``0`` to ``255``, like ``255, 0, 0, 127`` for half-transparent red." diff --git a/novelwriter/assets/images/welcome-dark.jpg b/novelwriter/assets/images/welcome-dark.jpg deleted file mode 100644 index 1b434912..00000000 Binary files a/novelwriter/assets/images/welcome-dark.jpg and /dev/null differ diff --git a/novelwriter/assets/images/welcome-light.jpg b/novelwriter/assets/images/welcome-light.jpg deleted file mode 100644 index 1a1b9f6a..00000000 Binary files a/novelwriter/assets/images/welcome-light.jpg and /dev/null differ diff --git a/novelwriter/assets/images/welcome.webp b/novelwriter/assets/images/welcome.webp new file mode 100644 index 00000000..3831aafe Binary files /dev/null and b/novelwriter/assets/images/welcome.webp differ diff --git a/novelwriter/assets/themes/default_dark.conf b/novelwriter/assets/themes/default_dark.conf index e2e41efb..267fbcb0 100644 --- a/novelwriter/assets/themes/default_dark.conf +++ b/novelwriter/assets/themes/default_dark.conf @@ -54,7 +54,7 @@ background = #363636 text = default link = blue headertext = green -headertag = green:160 +headertag = green:D150 emphasis = orange dialog = blue altdialog = blue diff --git a/novelwriter/assets/themes/default_light.conf b/novelwriter/assets/themes/default_light.conf index ad38e0e7..e08de69f 100644 --- a/novelwriter/assets/themes/default_light.conf +++ b/novelwriter/assets/themes/default_light.conf @@ -54,7 +54,7 @@ background = #ffffff text = #000000 link = blue headertext = green -headertag = green:160 +headertag = green:L135 emphasis = orange dialog = blue altdialog = blue diff --git a/novelwriter/assets/themes/dracula.conf b/novelwriter/assets/themes/dracula.conf index 0d5dd373..ed1f1e92 100644 --- a/novelwriter/assets/themes/dracula.conf +++ b/novelwriter/assets/themes/dracula.conf @@ -70,7 +70,7 @@ background = #282a36 text = #f8f8f2 link = #ff79c6 headertext = purple -headertag = #bd93f9a0 +headertag = purple:D150 emphasis = orange dialog = green altdialog = yellow @@ -85,4 +85,4 @@ spellcheckline = red errorline = green replacetag = yellow modifier = cyan -texthighlight = #f1fa8c60 +texthighlight = yellow:96 diff --git a/novelwriter/assets/themes/grey_dark.conf b/novelwriter/assets/themes/grey_dark.conf index c51879a3..de9a1f35 100644 --- a/novelwriter/assets/themes/grey_dark.conf +++ b/novelwriter/assets/themes/grey_dark.conf @@ -8,7 +8,7 @@ license = CC BY-SA 4.0 licenseurl = https://creativecommons.org/licenses/by-sa/4.0/ [Base] -default = #cccccc +default = #c8c8c8 faded = #949494 red = #f2777a orange = #f99139 @@ -44,28 +44,28 @@ link = blue linkvisited = blue [GUI] -helptext = #a4a4a4 +helptext = default:D120 fadedtext = faded errortext = red [Syntax] background = #363636 -text = #c8c8c8 -link = #c8c8c8 -headertext = #e1e1e1 -headertag = #e1e1e1a0 -emphasis = #c8c8c8 -dialog = #c8c8c8 -altdialog = #c8c8c8 -note = #c8c8c8 +text = default +link = default +headertext = default:L115 +headertag = default:D125 +emphasis = default +dialog = default +altdialog = default +note = default hidden = faded -shortcode = #e1e1e1 -keyword = #e1e1e1 -tag = #c8c8c8 -value = #c8c8c8 -optional = #e1e1e1 +shortcode = default:L115 +keyword = default:L115 +tag = default +value = default +optional = default:L115 spellcheckline = red errorline = green -replacetag = #e1e1e1 -modifier = #e1e1e1 +replacetag = default:L115 +modifier = default:L115 texthighlight = #ffffff40 diff --git a/novelwriter/assets/themes/grey_light.conf b/novelwriter/assets/themes/grey_light.conf index 3bd22238..ace40f8c 100644 --- a/novelwriter/assets/themes/grey_light.conf +++ b/novelwriter/assets/themes/grey_light.conf @@ -8,7 +8,7 @@ license = CC BY-SA 4.0 licenseurl = https://creativecommons.org/licenses/by-sa/4.0/ [Base] -default = #303030 +default = #282828 faded = #6c6c6c red = #a62a2d orange = #b36829 @@ -44,28 +44,28 @@ link = blue linkvisited = blue [GUI] -helptext = #5c5c5c +helptext = default:L225 fadedtext = faded errortext = red [Syntax] background = #ffffff -text = #141414 -link = #141414 -headertext = #000000 -headertag = #000000a0 -emphasis = #141414 -dialog = #141414 -altdialog = #141414 -note = #141414 +text = default +link = default +headertext = default:D200 +headertag = default:L400 +emphasis = default +dialog = default +altdialog = default +note = default hidden = faded -shortcode = #000000 -keyword = #000000 -tag = #141414 -value = #141414 -optional = #000000 +shortcode = default:D200 +keyword = default:D200 +tag = default +value = default +optional = default:D200 spellcheckline = red errorline = green -replacetag = #000000 -modifier = #000000 +replacetag = default:D200 +modifier = default:D200 texthighlight = #00000040 diff --git a/novelwriter/assets/themes/light_owl.conf b/novelwriter/assets/themes/light_owl.conf index 8851b0d2..512f4019 100644 --- a/novelwriter/assets/themes/light_owl.conf +++ b/novelwriter/assets/themes/light_owl.conf @@ -77,7 +77,7 @@ headertag = blue:160 emphasis = orange dialog = green altdialog = yellow -note = #80764b +note = yellow:D175 hidden = faded shortcode = blue keyword = red diff --git a/novelwriter/assets/themes/night_owl.conf b/novelwriter/assets/themes/night_owl.conf index 3e0a5aca..2fbf7d60 100644 --- a/novelwriter/assets/themes/night_owl.conf +++ b/novelwriter/assets/themes/night_owl.conf @@ -32,7 +32,7 @@ default = #d6deeb faded = #637777 red = #f78c6c orange = #ecc48d -yellow = #addb67 +yellow = #ffeb95 green = #addb67 cyan = #7fdbca blue = #82aaff @@ -77,7 +77,7 @@ headertag = blue:160 emphasis = orange dialog = green altdialog = yellow -note = #fff9ca +note = yellow:L115 hidden = faded shortcode = blue keyword = red diff --git a/novelwriter/assets/themes/snazzy.conf b/novelwriter/assets/themes/snazzy.conf index 737107e7..f2fa7785 100644 --- a/novelwriter/assets/themes/snazzy.conf +++ b/novelwriter/assets/themes/snazzy.conf @@ -66,12 +66,12 @@ background = #fafbfc text = default link = blue headertext = green -headertag = #2dae58a0 +headertag = green:D125 emphasis = purple dialog = blue altdialog = yellow -note = #78bbb9 -hidden = #9194a2 +note = cyan +hidden = purple:D150 shortcode = purple keyword = blue tag = green @@ -81,4 +81,4 @@ spellcheckline = red errorline = green replacetag = cyan modifier = purple -texthighlight = #cf9c0060 +texthighlight = yellow:96 diff --git a/novelwriter/assets/themes/solarized_dark.conf b/novelwriter/assets/themes/solarized_dark.conf index 495d68eb..8b07003a 100644 --- a/novelwriter/assets/themes/solarized_dark.conf +++ b/novelwriter/assets/themes/solarized_dark.conf @@ -58,12 +58,12 @@ button = #073642 buttontext = default brighttext = #073642 highlight = cyan -highlightedtext = #002b36 +highlightedtext = default link = blue linkvisited = blue [GUI] -helptext = purple +helptext = cyan fadedtext = faded errortext = red @@ -71,18 +71,18 @@ errortext = red background = #073642 text = default link = blue -headertext = default:196 +headertext = default:D125 headertag = cyan emphasis = blue dialog = cyan altdialog = cyan -note = cyan:196 -hidden = default:196 +note = cyan:L115 +hidden = default:D150 shortcode = yellow keyword = green tag = orange value = orange -optional = cyan:196 +optional = cyan:L115 spellcheckline = orange errorline = red replacetag = green diff --git a/novelwriter/assets/themes/solarized_light.conf b/novelwriter/assets/themes/solarized_light.conf index bfdcdad1..22b165b9 100644 --- a/novelwriter/assets/themes/solarized_light.conf +++ b/novelwriter/assets/themes/solarized_light.conf @@ -59,12 +59,12 @@ button = #eee8d5 buttontext = default brighttext = #eee8d5 highlight = cyan -highlightedtext = #fdf6e3 +highlightedtext = default link = blue linkvisited = blue [GUI] -helptext = purple +helptext = cyan fadedtext = faded errortext = red @@ -72,18 +72,18 @@ errortext = red background = #eee8d5 text = default link = blue -headertext = default:196 +headertext = default:L125 headertag = cyan emphasis = blue dialog = cyan altdialog = cyan -note = cyan:196 -hidden = default:196 +note = cyan:D125 +hidden = default:L200 shortcode = yellow keyword = green tag = orange value = orange -optional = cyan:196 +optional = cyan:D125 spellcheckline = orange errorline = red replacetag = green diff --git a/novelwriter/assets/themes/tango_dark.conf b/novelwriter/assets/themes/tango_dark.conf index dd0b9746..252bce4d 100644 --- a/novelwriter/assets/themes/tango_dark.conf +++ b/novelwriter/assets/themes/tango_dark.conf @@ -41,20 +41,20 @@ note = yellow window = #555753 windowtext = default base = #2e3436 -alternatebase = #888a85 +alternatebase = #454e51 text = default tooltipbase = #ffffc0 tooltiptext = #15150d button = #555753 buttontext = default brighttext = #555753 -highlight = #2c98f7 +highlight = blue highlightedtext = #ffffff link = blue linkvisited = blue [GUI] -helptext = #e9b96e +helptext = orange fadedtext = faded errortext = red @@ -67,7 +67,7 @@ headertag = blue:160 emphasis = orange dialog = green altdialog = yellow -note = #fcf2a4 +note = yellow:L115 hidden = faded shortcode = blue keyword = red diff --git a/novelwriter/assets/themes/tango_light.conf b/novelwriter/assets/themes/tango_light.conf index 047be605..c702de8d 100644 --- a/novelwriter/assets/themes/tango_light.conf +++ b/novelwriter/assets/themes/tango_light.conf @@ -48,13 +48,13 @@ tooltiptext = #15150d button = #d3d7cf buttontext = default brighttext = #d3d7cf -highlight = #3087c6 +highlight = blue:L200 highlightedtext = #ffffff link = blue linkvisited = blue [GUI] -helptext = #8f5902 +helptext = orange fadedtext = faded errortext = red @@ -67,7 +67,7 @@ headertag = blue:160 emphasis = orange dialog = green altdialog = yellow -note = #a78800 +note = yellow:D125 hidden = faded shortcode = blue keyword = red diff --git a/novelwriter/assets/themes/tomorrow.conf b/novelwriter/assets/themes/tomorrow.conf index b37ab4be..2736fdae 100644 --- a/novelwriter/assets/themes/tomorrow.conf +++ b/novelwriter/assets/themes/tomorrow.conf @@ -73,7 +73,7 @@ background = #ffffff text = #4d4d4c link = blue headertext = blue -headertag = blue:160 +headertag = blue:L135 emphasis = orange dialog = green altdialog = yellow diff --git a/novelwriter/assets/themes/tomorrow_night.conf b/novelwriter/assets/themes/tomorrow_night.conf index ea94cdec..c266b31d 100644 --- a/novelwriter/assets/themes/tomorrow_night.conf +++ b/novelwriter/assets/themes/tomorrow_night.conf @@ -73,7 +73,7 @@ background = #1d1f21 text = default link = blue headertext = blue -headertag = blue:160 +headertag = blue:D150 emphasis = orange dialog = green altdialog = yellow diff --git a/novelwriter/assets/themes/tomorrow_night_blue.conf b/novelwriter/assets/themes/tomorrow_night_blue.conf index 8ac01e1e..f96448af 100644 --- a/novelwriter/assets/themes/tomorrow_night_blue.conf +++ b/novelwriter/assets/themes/tomorrow_night_blue.conf @@ -73,7 +73,7 @@ background = #002451 text = default link = blue headertext = blue -headertag = blue:160 +headertag = blue:D150 emphasis = orange dialog = green altdialog = yellow diff --git a/novelwriter/assets/themes/tomorrow_night_bright.conf b/novelwriter/assets/themes/tomorrow_night_bright.conf index 4a0bbd9c..82cac1d0 100644 --- a/novelwriter/assets/themes/tomorrow_night_bright.conf +++ b/novelwriter/assets/themes/tomorrow_night_bright.conf @@ -73,7 +73,7 @@ background = #000000 text = default link = blue headertext = blue -headertag = blue:160 +headertag = blue:D150 emphasis = orange dialog = green altdialog = yellow diff --git a/novelwriter/assets/themes/tomorrow_night_eighties.conf b/novelwriter/assets/themes/tomorrow_night_eighties.conf index 8f9850fa..e14b0dac 100644 --- a/novelwriter/assets/themes/tomorrow_night_eighties.conf +++ b/novelwriter/assets/themes/tomorrow_night_eighties.conf @@ -73,7 +73,7 @@ background = #2d2d2d text = default link = blue headertext = blue -headertag = blue:160 +headertag = blue:D150 emphasis = orange dialog = green altdialog = yellow diff --git a/novelwriter/gui/theme.py b/novelwriter/gui/theme.py index 4ab4f7d8..89d3fecd 100644 --- a/novelwriter/gui/theme.py +++ b/novelwriter/gui/theme.py @@ -244,32 +244,6 @@ class GuiTheme: window = palette.window().color() return text.lightnessF() > window.lightnessF() - def parseColor(self, value: str, default: QColor = QtBlack) -> QColor: - """Parse a string as a colour value.""" - if value in self._qColors: - # Named colour - return self._qColors[value] - elif value.startswith("#") and len(value) == 7: - # Assume #RRGGBB - return QColor.fromString(value) - elif value.startswith("#") and len(value) == 9: - # Assume #RRGGBBAA and convert to #AARRGGBB - return QColor.fromString(f"#{value[7:9]}{value[1:7]}") - elif ":" in value: - # Colour name and alpha - name, _, alpha = value.partition(":") - color = QColor(self._qColors.get(name.strip(), default)) - color.setAlpha(checkInt(alpha, 255)) - return color - elif "," in value: - # Integer red, green, blue, alpha - data = value.split(",") - result = [0, 0, 0, 255] - for i in range(min(len(data), 4)): - result[i] = checkInt(data[i].strip(), result[i]) - return QColor(*result) - return default - def loadTheme(self, force: bool = False) -> bool: """Load the currently specified GUI theme. The boolean return can be used to determine if the GUI needs refreshing. @@ -489,6 +463,37 @@ class GuiTheme: # Internal Functions ## + def _parseColor(self, value: str, default: QColor = QtBlack) -> QColor: + """Parse a string as a colour value.""" + if value in self._qColors: + # Named colour + return self._qColors[value] + elif value.startswith("#") and len(value) == 7: + # Assume #RRGGBB + return QColor.fromString(value) + elif value.startswith("#") and len(value) == 9: + # Assume #RRGGBBAA and convert to #AARRGGBB + return QColor.fromString(f"#{value[7:9]}{value[1:7]}") + elif ":" in value: + # Colour name and alpha + name, _, adjust = value.partition(":") + color = QColor(self._qColors.get(name.strip(), default)) + if adjust.startswith("L"): + color = color.lighter(checkInt(adjust[1:], 100)) + elif adjust.startswith("D"): + color = color.darker(checkInt(adjust[1:], 100)) + else: + color.setAlpha(checkInt(adjust, 255)) + return color + elif "," in value: + # Integer red, green, blue, alpha + data = value.split(",") + result = [0, 0, 0, 255] + for i in range(min(len(data), 4)): + result[i] = checkInt(data[i].strip(), result[i]) + return QColor(*result) + return default + def _setBaseColor(self, key: str, color: QColor) -> None: """Set the colour for a named colour.""" self._qColors[key] = QColor(color) @@ -544,7 +549,7 @@ class GuiTheme: def _readColor(self, parser: ConfigParser, section: str, name: str) -> QColor: """Parse a colour value from a config string.""" - return self.parseColor(parser.get(section, name, fallback="default")) + return self._parseColor(parser.get(section, name, fallback="default")) def _setPalette( self, parser: ConfigParser, section: str, name: str, value: QPalette.ColorRole @@ -634,7 +639,7 @@ class GuiIcons: "unfold": ("unfold-show", "unfold-hide"), } IMAGE_MAP: Final[dict[str, tuple[str, str]]] = { - "welcome": ("welcome-light.jpg", "welcome-dark.jpg"), + "welcome": ("welcome.webp", "welcome.webp"), "nw-text": ("novelwriter-text-light.svg", "novelwriter-text-dark.svg"), } diff --git a/novelwriter/tools/welcome.py b/novelwriter/tools/welcome.py index 9b0abe33..9c3f5776 100644 --- a/novelwriter/tools/welcome.py +++ b/novelwriter/tools/welcome.py @@ -32,7 +32,7 @@ from PyQt6.QtCore import ( QAbstractListModel, QModelIndex, QObject, QPoint, QSize, Qt, pyqtSignal, pyqtSlot ) -from PyQt6.QtGui import QAction, QCloseEvent, QColor, QFont, QPainter, QPaintEvent, QPen, QShortcut +from PyQt6.QtGui import QAction, QCloseEvent, QFont, QPainter, QPaintEvent, QPen, QShortcut from PyQt6.QtWidgets import ( QApplication, QFileDialog, QFormLayout, QHBoxLayout, QLabel, QLineEdit, QListView, QMenu, QPushButton, QScrollArea, QStackedWidget, @@ -77,7 +77,6 @@ class GuiWelcome(NDialog): self.bgImage = SHARED.theme.getDecoration("welcome") self.nwImage = SHARED.theme.getDecoration("nw-text", h=36) - self.bgColor = QColor(54, 54, 54) if SHARED.theme.isDarkTheme else QColor(255, 255, 255) self.nwLogo = QLabel(self) self.nwLogo.setPixmap(SHARED.theme.getPixmap("novelwriter", (128, 128))) @@ -178,8 +177,8 @@ class GuiWelcome(NDialog): hPix = min(hWin, 600) tMode = Qt.TransformationMode.SmoothTransformation painter = QPainter(self) - painter.fillRect(self.rect(), self.bgColor) painter.drawPixmap(0, hWin - hPix, self.bgImage.scaledToHeight(hPix, tMode)) + painter.end() super().paintEvent(event) return diff --git a/tests/test_gui/test_gui_theme.py b/tests/test_gui/test_gui_theme.py index d14304d1..4c834d38 100644 --- a/tests/test_gui/test_gui_theme.py +++ b/tests/test_gui/test_gui_theme.py @@ -52,29 +52,40 @@ def testGuiTheme_ParseColor(): theme._qColors["red"] = QColor(255, 0, 0) theme._qColors["green"] = QColor(0, 255, 0) theme._qColors["blue"] = QColor(0, 0, 255) + theme._qColors["grey"] = QColor(127, 127, 127) # By Name - assert theme.parseColor("red").getRgb() == (255, 0, 0, 255) - assert theme.parseColor("green").getRgb() == (0, 255, 0, 255) - assert theme.parseColor("blue").getRgb() == (0, 0, 255, 255) - assert theme.parseColor("bob").getRgb() == (0, 0, 0, 255) + assert theme._parseColor("red").getRgb() == (255, 0, 0, 255) + assert theme._parseColor("green").getRgb() == (0, 255, 0, 255) + assert theme._parseColor("blue").getRgb() == (0, 0, 255, 255) + assert theme._parseColor("bob").getRgb() == (0, 0, 0, 255) # CSS Format - assert theme.parseColor("#ff0000").getRgb() == (255, 0, 0, 255) - assert theme.parseColor("#ff00007f").getRgb() == (255, 0, 0, 127) - assert theme.parseColor("#ff00").getRgb() == (0, 0, 0, 255) # Too short -> ignored - assert theme.parseColor("#ff00007f15").getRgb() == (0, 0, 0, 255) # Too long -> ignored + assert theme._parseColor("#ff0000").getRgb() == (255, 0, 0, 255) + assert theme._parseColor("#ff00007f").getRgb() == (255, 0, 0, 127) + assert theme._parseColor("#ff00").getRgb() == (0, 0, 0, 255) # Too short -> ignored + assert theme._parseColor("#ff00007f15").getRgb() == (0, 0, 0, 255) # Too long -> ignored # Name + Alpha - assert theme.parseColor("red:255").getRgb() == (255, 0, 0, 255) - assert theme.parseColor("red:127").getRgb() == (255, 0, 0, 127) - assert theme.parseColor("red:512").getRgb() == (255, 0, 0, 255) # Value truncated + assert theme._parseColor("red:255").getRgb() == (255, 0, 0, 255) + assert theme._parseColor("red:127").getRgb() == (255, 0, 0, 127) + assert theme._parseColor("red:512").getRgb() == (255, 0, 0, 255) # Value truncated + + # Name + Lighter + assert theme._parseColor("grey:L100").getRgb() == (127, 127, 127, 255) + assert theme._parseColor("grey:L150").getRgb() == (190, 190, 190, 255) + assert theme._parseColor("grey:L50").getRgb() == (63, 63, 63, 255) + + # Name + Darker + assert theme._parseColor("grey:D100").getRgb() == (127, 127, 127, 255) + assert theme._parseColor("grey:D150").getRgb() == (85, 85, 85, 255) + assert theme._parseColor("grey:D50").getRgb() == (254, 254, 254, 255) # Values - assert theme.parseColor("255, 0, 0").getRgb() == (255, 0, 0, 255) - assert theme.parseColor("255, 0, 0, 255").getRgb() == (255, 0, 0, 255) - assert theme.parseColor("255, 0, 0, 127").getRgb() == (255, 0, 0, 127) - assert theme.parseColor("255, 0, 0, 127, 42").getRgb() == (255, 0, 0, 127) # Truncated + assert theme._parseColor("255, 0, 0").getRgb() == (255, 0, 0, 255) + assert theme._parseColor("255, 0, 0, 255").getRgb() == (255, 0, 0, 255) + assert theme._parseColor("255, 0, 0, 127").getRgb() == (255, 0, 0, 127) + assert theme._parseColor("255, 0, 0, 127, 42").getRgb() == (255, 0, 0, 127) # Truncated @pytest.mark.gui