Is dark mode: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
|description=Use a different text color based on the user's theme. | |description=Use a different text color based on the user's theme. | ||
|code= | |code= | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="d"> | ||
string WARN_COLOR = is_dark_mode() ? "#FFFF00" : "#A0522D"; | string WARN_COLOR = is_dark_mode() ? "#FFFF00" : "#A0522D"; | ||
print("This is a warning.", WARN_COLOR); | print("This is a warning.", WARN_COLOR); |
Latest revision as of 05:13, 21 December 2020
Function Syntax
- Checks if the current KoLmafia theme is dark mode.
Checks if the current KoLmafia theme is one of the "dark mode" themes. This function was added in r20566.
Code Samples
Use a different text color based on the user's theme.
string WARN_COLOR = is_dark_mode() ? "#FFFF00" : "#A0522D";
print("This is a warning.", WARN_COLOR);