INNER CODE UNIT · Python

_color_hex

ok-oldking/ok-script · ok/ui/web/app.py:148

def _color_hex(red, green, blue):
    return f"#{red:02x}{green:02x}{blue:02x}"


def _windows_system_accents():
    """Return Windows primary fills for light and dark UI modes."""
    try:
        from ok.rotypes.Windows.UI.ViewManagement import UIColorType, get_color_value

        light = get_color_value(UIColorType.AccentDark1)
        dark = get_color_value(UIColorType.AccentLight2)
        return {
            "light": _color_hex(light.red, light.green, light.blue),
            "dark": _color_hex(dark.red, dark.green, dark.blue),
        }
    except (ImportError, OSError, TypeError, AttributeError):
        pass

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…