I have just looked through the OS page of the documentation and have done a little bit more research beyond that, and I couldn't find a way to detect if the player uses Dark Mode or Light Mode on their Android device in my Godot game.

Because my game's visuals are perfectly suited for getting recolored into the opposite brightness, I want to implement switching between both modes instead of just sticking to dark mode.

For a native experience, I want to read what the system toggle says instead of having to make a redundant In-Game toggle.

To help you find me the answer, I proposed a sample scene which is literally just a ColorRect node with this script:

extends ColorRect


func _ready():
	
	if OS.dark_mode: #Error#Invalid get index 'dark_mode' (on base: '_OS').
		$".".modulate = Color8(0, 0, 0)	#Recolor to Black
	else:
		$".".modulate = Color8(255, 255, 255)	#Recolor to White

I have no idea what the 'correct' way is, but my gut would be to investigate OS.execute calling a Kotlin script that checks for dark mode status. Specifically, there is a snippet at the end of this page which may be what you need: https://developer.android.com/guide/topics/ui/look-and-feel/darktheme That said, I have no idea how os.execute runs on Android as who knows what permission issues may be at play.

Given night mode has apparently only been introduced since Android 10, this seems a particularly fringe use-case that I would not expect in OS (potentially ever given it is only relevant to one platform?), as the vast majority of users won't have that option yet.

2 years later