view colors.py @ 54:2e9f6582c3d2

ColourButton: use complete CSS instead overriding platfrom style This is as suggested by this answer: https://stackoverflow.com/a/57846090/11352427 Seems like it's still possible to override system styles as long as we set all parts of the CSS. The key seems to be to also set the radius so that Qt will recolour the button.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Sun, 08 Sep 2019 18:43:19 -0400 (2019-09-08)
parents 655899862ff6
children 74ebf2f4e801
line wrap: on
line source
from PyQt5 import QtGui

NES_PALETTE = [
    "#7C7C7C",  # 0
    "#0000FC",  # 1
    "#0000BC",  # 2
    "#4428BC",  # 3
    "#940084",  # 4
    "#A80020",  # 5
    "#A81000",  # 6
    "#881400",  # 7
    "#503000",  # 8
    "#007800",  # 9
    "#006800",  # 10
    "#005800",  # 11
    "#004058",  # 12
    "#000000",  # 13
    "#000000",  # 14
    "#000000",  # 15

    "#BCBCBC",  # 16
    "#0078F8",  # 17
    "#0058F8",  # 18
    "#6844FC",  # 19
    "#D800CC",  # 20
    "#E40058",  # 21
    "#F83800",  # 22
    "#E45C10",  # 23
    "#AC7C00",  # 24
    "#00B800",  # 25
    "#00A800",  # 26
    "#00A844",  # 27
    "#008888",  # 28
    "#000000",  # 29
    "#000000",  # 30
    "#000000",  # 31

    "#F8F8F8",  # 32
    "#3CBCFC",  # 33
    "#6888FC",  # 34
    "#9878F8",  # 35
    "#F878F8",  # 36
    "#F85898",  # 37
    "#F87858",  # 38
    "#FCA044",  # 39
    "#F8B800",  # 40
    "#B8F818",  # 41
    "#58D854",  # 42
    "#58F898",  # 43
    "#00E8D8",  # 44
    "#787878",  # 45
    "#000000",  # 46
    "#000000",  # 47

    "#FCFCFC",  # 48
    "#A4E4FC",  # 49
    "#B8B8F8",  # 50
    "#D8B8F8",  # 51
    "#F8B8F8",  # 52
    "#F8A4C0",  # 53
    "#F0D0B0",  # 54
    "#FCE0A8",  # 55
    "#F8D878",  # 56
    "#D8F878",  # 57
    "#B8F8B8",  # 58
    "#B8F8D8",  # 59
    "#00FCFC",  # 60
    "#F8D8F8",  # 61
    "#000000",  # 62
    "#000000",  # 63
]

QT_NES_PALETTE = [QtGui.QColor(color).rgb() for color in NES_PALETTE]