Reputation: 2530
I'm trying to use the Purple and other colors specified on this page but the colors aren't displaying accurately.
This is the image of Purple color being displayed on my device as well as linux:
Here are the relevant code snippets from the default Hello World app:
.pro file:
QT += qml quick quickcontrols2
main.cpp:
#include <QQuickStyle>
In int main(int argc, char *argv[])
QQuickStyle::setStyle("Material");
main.qml:
Material.theme: Material.Dark
Material.accent: Material.Purple
Upvotes: 4
Views: 2326
Reputation: 5836
The Material Design specs are a bit inconsistent about this. In the sticker sheet, all buttons are using such lighter shade in the dark theme, whereas elsewhere in the specs they are mostly using the same darker shade than in the light theme. We're considering switching it back, but meanwhile, here's a temporary workaround using Material.color()
:
Material.theme: Material.Dark
Material.accent: Material.color(Material.Purple)
Upvotes: 6