MycroftAI / mycroft-gui

The Graphical User Interface used by the Mycroft Mark II and more
Apache License 2.0
167 stars 57 forks source link

Add Custom Color Scheme Support #117

Closed AIIX closed 2 years ago

AIIX commented 2 years ago

Example Configuration:

[General]
useCustomTheme=true
primaryColor=#ff2a2e32
secondaryColor=#ff35bfa4
textColor=#fffcfcfc

Example Usage In Skills:

Mycroft.CardDelegate {

    Rectangle {
       id: exampleRect
       ... 
       radius: 20
       color: Mycroft.ColorScheme.secondaryColor

        Button {
            ...
             background: Rectangle {
                 color: Mycroft.ColorScheme.primaryColor
             }
             contentItem: Text {
                  text: "60-30-10 Color Scheme Usage Example"
                 color: Mycroft.ColorScheme.textColor
             } 
         }
    }
} 
AIIX commented 2 years ago

Closing this in favour of using Kirigami PlatformTheme Plugin to reduce duplication work and since every platform might want to implement it differently, it would probably be best for the platform to export their own PlatformTheme plugin and use Kirigami.Theme roles as required,

An example PlatformTheme plugin implementation can be found https://github.com/OpenVoiceOS/mycroft-embedded-shell/pull/3

krisgesling commented 2 years ago

Yeah cool, if we can achieve this through a plugin that doesn't need to be embedded in the framework that sounds great.

I love the idea, I've just been thinking about the specifics of how we'd use it, what we'd want the colors called etc. This way we don't need to make a decision for all projects :clap: