[PYTHON] Maya backgroundColor color swatch

What is the actual color of backGroundColor that adds color to the UI? I was curious, so I looked it up.

image.png

I will display it all over.


import maya.cmds as cmds
import pymel.core as pm

windowtitle = 'ColorCheck'
wndwName    = 'ColorCheck'

if pm.window(wndwName, ex=True):
    pm.deleteUI(wndwName)
win = pm.window(wndwName, t=windowtitle, w=True )

with win:
    SCL = pm.scrollLayout()
    with SCL:
        column = pm.columnLayout(adj=True)
        with column:
            for i in range(0,11):
                for j in range(0,11):
                    RCL = pm.rowColumnLayout(numberOfColumns=22)
                    with RCL:
                        for k in range(0,11):
                            a = i * 0.1
                            b = j * 0.1
                            c = k * 0.1
                            pm.button(
                                l=u'%s %s %s'%(str(a), str(b), str(c)),
                                bgc=(a, b ,c),
                                c="print %s, %s, %s"%(str(a), str(b), str(c)),
                                w=80,
                                h=30,
                                )
                            pm.separator(st="none", w=5)
                    pm.separator(st="none", h=5)

Execution result image.png

It's vivid!

Recommended Posts

Maya backgroundColor color swatch