HISE Logo Forum
    • Categories
    • Register
    • Login

    get a random Colour constant?

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 114 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.
    • ulrikU
      ulrik
      last edited by

      I know I saw somewhere that it's possible to randomly select a Colour constant, but I can't find it anywhere.
      Anybody know?

      Hise Develop branch
      MacOs 15.3.1, Xcode 16.2
      http://musikboden.se

      1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by

        If you want to use the colour constants you'd need to put them all in an array an use a random integer as the index.

        If you just want a random colour then you can use something like g.setColour(Math.randInt(1000000, 999999)); - you might need to play around with the range.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        ulrikU 1 Reply Last reply Reply Quote 0
        • ulrikU
          ulrik @d.healey
          last edited by

          @d-healey Yes I know I can do that but I think I saw @Christoph-Hart use another way to set a random Colour constant...

          Hise Develop branch
          MacOs 15.3.1, Xcode 16.2
          http://musikboden.se

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

          28

          Online

          1.7k

          Users

          11.8k

          Topics

          102.8k

          Posts