Telegram Android only defines whether a theme is dark or not based on the name of that theme.
If a theme is named "Dark Blue" or "Night", it will be considered as dark. Otherwise it will be considered as light. This cause issues with the Dark/Light theme switcher in the Drawer which uses the last dark theme for the dark theme.
Create a theme based on the Night or Dark Blue theme.
Rename that theme (however you want) to something other than "Night" or "Dark Blue".
Set this new custom theme as your current theme
Go back on the main screen and open the drawer
Toggle that Light/Dark switch above the multiple accounts drop down arrow.
Current result
Your new custom theme (which is based on a dark theme) is now considered as light. This means the Light/Dark switch will switch from your theme to the previous night theme.
Expected result
Dark theme should be considered dark based on the windowBackgroundWhite field AND/OR on a boolean attribute.
How exactly?
The boolean attribute is just a feature suggestion, but it should at least be based on windowBackgroundWhite. Assuming the hex value of windowBackgroundWhite is #242424, converting this color to HSL could allow us to obtain the lightness of this color, which in this case is 14%. So, by converting any color to HSL and obtaining its lightness, we can know whether the color is dark (L < 50) or light (L >= 50).
As mentionned above, the boolean attribute is just a feature suggestion. It could allow users to force set a theme to dark or light even if the windowBackgroundWhite indicates the opposite. It could be done with the built-in theme editor, so if users change windowBackgroundWhite, the boolean is set accordingly. However, if the user manually updates the boolean, changing windowBackgroundWhite doesn't update the boolean anymore.
This is the sole reason I had to look this up. I want this theme to be used by others but I have to resort to either light mode with my custom dark theme, or use Telegram's preset dark theme to use this new chat theme. I want to be able to have my custom theme as a dark theme
Log in here to report bugs or suggest features. Please enter your phone number in the international format and we will send a confirmation message to your account via Telegram.