Forum
    • Categories
    • Register
    • Login

    Get Panel Attributes - Colours

    Scheduled Pinned Locked Moved Scripting
    9 Posts 4 Posters 28 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ChazroxC
      Chazrox
      last edited by Chazrox

      I cant seem to get the colour attributes to work in script with a panel. Im trying to set the panels colours by using panel.get("bgColour"); but it returns this number....

      Screenshot 2026-05-28 at 1.05.38 AM.png

      Screenshot 2026-05-28 at 1.03.52 AM.png

      but then when I pasted that number from the console into here to show u guys it shows up as this whole object...weird.

      {
        "alignment": "left",
        "fontStyle": "plain",
        "fontSize": 16.0,
        "fontName": "Source Code Pro",
        "textColour": "3253075780",
        "itemColour2": 4212199697,
        "itemColour": 0,
        "bgColour": 0,
        "width": 140.0,
        "height": 30.0
      }
      

      How do I get the panel colours?

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @Chazrox
        last edited by

        @Chazrox that is the color, as a decimal rather than hex.

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        ChazroxC 1 Reply Last reply Reply Quote 0
        • ChazroxC
          Chazrox @David Healey
          last edited by

          @David-Healey How do I convert that to a HEX? and why did it produce that object when I pasted that decimal number in the chat?

          dannytaurusD David HealeyD 2 Replies Last reply Reply Quote 0
          • dannytaurusD
            dannytaurus @Chazrox
            last edited by dannytaurus

            @Chazrox It's possible that you didn't actually copy the decimal value and it pasted whatever else was on your clipboard.

            If you use a clipboard manager, call it up and see what's actually in your clipboard history.

            Meat Beats: https://meatbeats.com
            Klippr Video: https://klippr.video

            ChazroxC 1 Reply Last reply Reply Quote 1
            • David HealeyD
              David Healey @Chazrox
              last edited by

              @Chazrox said in Get Panel Attributes - Colours:

              How do I convert that to a HEX?

              Engine.intToHexString() but you should be able to use the integer representation directly in your paint routines I think.

              Free HISE Bootcamp Full Course for beginners.
              YouTube Channel - Public HISE tutorials
              My Patreon - HISE tutorials

              ChazroxC 1 Reply Last reply Reply Quote 0
              • ChazroxC
                Chazrox @dannytaurus
                last edited by

                @dannytaurus quite possible!

                1 Reply Last reply Reply Quote 0
                • ChazroxC
                  Chazrox @David Healey
                  last edited by

                  @David-Healey Yup that worked. Thanks!

                  Works.

                  var ColourNOW = 3758365736;
                  
                  Console.print(Engine.intToHexString(ColourNOW));
                  
                  panelColourTesting.set("itemColour", ColourNOW);
                  
                  
                  1 Reply Last reply Reply Quote 0
                  • ustkU
                    ustk
                    last edited by

                    In the end, a number is a number. The format (base) is just a chosen representation of the same number, be it decimal, hexadecimal, binary, octal or whatever fancy base-factorial one can invent 🤪

                    Hise made me an F5 dude, any other app just suffers...

                    ChazroxC 1 Reply Last reply Reply Quote 0
                    • ChazroxC
                      Chazrox @ustk
                      last edited by

                      @ustk great insight! Very true. I guess I could have just tried the decimal point first but I automatically thought it would be wrong. I just tried it and it does work both ways. Thanks!

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post

                      22

                      Online

                      2.4k

                      Users

                      13.7k

                      Topics

                      119.3k

                      Posts