Help with component colors



  • I'm trying to script colors of a panel and need some help.

    Here are the colors I'm trying to use:
    component colors.png

    my json code looks like this:

    Content.setPropertiesFromJSON(name, {
    
    		"width": 40,
    		"height": 50,
                    "bgColour": FF101010,
    		"itemColour": FFB0B938,     
    		"itemColour2": 62000000,
    		"textColour": 00FEFEFE,
    		"saveInPreset": false,
    		"opaque": 1
    		});
    

    The result looks like this:
    script resut.png

    and the text color is giving me an error in the Console:
    textcolor.png
    textcolor error.png

    Does anyone know what I'm doing wrong here?
    Thanks!



  • Use a paint routine, it will give you more control. No idea about the error.

    Edit: Oh actually the error might be because it expects a hex value, so put 0x before your colour value. Or try making the colour value a string with a # at the beginning.



  • @d-healey said in Help with component colors:

    Edit: Oh actually the error might be because it expects a hex value, so put 0x before your colour value. Or try making the colour value a string with a # at the beginning.

    as string didn't work, but adding 0x was the cure! 😻


Log in to reply
 

5
Online

965
Users

3.4k
Topics

29.4k
Posts