Can I set custom colors in G4P?

edited May 2015 in Library Questions

I'd like to choose my own text and background colors in a GLabel. I can't find an example that sets custom colors or makes a custom scheme, and the reference for GCScheme doesn't seem to support custom user schemes.

Is there any way for me to tell a label, "use this color for the text, and this color for the background" for colors of my own choosing?

Tagged:

Answers

  • Answer ✓

    Unfortunately not easily. You can define your own color scheme read this discussion to start with.

  • Thanks, Quark! I'm happy to do that. Can you give me some guidance on how to interpret the user_gui_palette.png file so my new colors work properly? It looks like there's a dark-to-white ramp in columns 2 through 7 (starting with 0), but I don't know how to interpret the other columns.

  • Each horizontal row is a color scheme.

    IMPORTANT Use your own colors but roughly match the brightness in each column.

    I suggest that you just give it a try by creating and modifying the png. Unfortunately there is no real documentation on this.

  • For future persons who are looking for an answer to this question, here's what I found. My UI right now uses only labels, sliders, buttons, check boxes, and text boxes, so that's all that I have data on. Here's the function of each box in a row of the user_gui_palette.png file, left to right starting with 0. This is not definitive or complete; it's just what I found by experimenting.

    • 0: [nothing observed]
    • 1: slider ticks
    • 2: text
    • 3: outlines of sliders and buttons
    • 4: button background
    • 5: slider internal fill
    • 6: label background
    • 7: text box background
    • 8-15: [nothing observed]
Sign In or Register to comment.