Skip to content

Mode detected is always light even if the background is black #51

Description

@cmoulliard

Issue

I did a test on my MacOS Sequoia 15.7.3` using the simple code example

///usr/bin/env jbang “$0” “$@” ; exit $?
//DEPS com.github.Dansoftowner:jSystemThemeDetector:3.6
//REPOS https://jitpack.io

package dev.snowdrop;

import com.jthemedetecor.OsThemeDetector;

public class ThemeDetector {
    public static void main(String[] args) {
        final OsThemeDetector detector = OsThemeDetector.getDetector();
        final boolean isDarkThemeUsed = detector.isDark();
        if (isDarkThemeUsed) {
            System.out.println("The OS uses a DARK theme");
        } else {
            System.out.println("The OS uses a LIGHT theme");
        }
    }
}

and I always got as response: LIGHT

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions