Forum
    • Categories
    • Register
    • Login

    Change color in a loop with i-variable?

    General Questions
    4
    12
    194
    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.
    • UrsBollhalderU
      UrsBollhalder
      last edited by

      Is it possible to change colors (0xff986734 * i ???) in a sensible way in a loop so that the color changes gradually with increasing i-values?

      πŸ™

      urs

      for (i = 0; i < NumOfSteps; i++)
      {
           this.data.play == i ? g.setGradientFill([0xffFF1236 , 0, 250, 0xff737170, 0, 10]) : g.setGradientFill([0xffFF5126, 0, 250, 0x98528170, 0, 10]);    
           g.fillEllipse([offset + StepSize * i + 1, (1 + xy[i] + param2[i]), 3, 3]); 
      }
      

      www.ursbollhalder.com
      www.Instagram.com/urs_bollhalder_composer

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @UrsBollhalder
        last edited by

        @UrsBollhalder I'm working on something similar for me too, If I get something working I'll make a snippet ;)

        I can't help pressing F5 in the forum...

        UrsBollhalderU 1 Reply Last reply Reply Quote 1
        • UrsBollhalderU
          UrsBollhalder @ustk
          last edited by

          @ustk Awesome! Thx!

          www.ursbollhalder.com
          www.Instagram.com/urs_bollhalder_composer

          ustkU 1 Reply Last reply Reply Quote 0
          • ustkU
            ustk @UrsBollhalder
            last edited by ustk

            @UrsBollhalder Here's a very limited one (only blue to black) to get an idea

            HiseSnippet 981.3ocsV01aaaCDlxwZnVccXEX+.H5mjSbSncRZyPZPcicxlwVREl65JZQQACEkMQjIEnnamwP9Ou+AaG0KVxqdYoFXBI.5t64N+buviJPqX7zTkF4z5UKR3Hmu1c7BoY5foTgDMZHx4abuflZ3ZbtpSWjPSS4gHGms9AqBmVMQYO+4yOkFSkLdkJD50JAi+yhYBSk1f9+jHN9bZH+UhY0PeP+QLkbfJVMG3yVtDTBkcMcB+RpEVCWjyWcVnvnziMTCOE4z7TU3hwSUeRli+0hTwUwbqPWzXHP4pOWEGZYrUKZvTQbXPYdmhfnDTUE1JuJ7ctWHBEK0WUM91LC3JOpWObZbazq6+M8HqidN0nWyb58P2wLsHwTYwxs66NRBMpHJzBpSqbrnFM2xcfBPHM6NidM+bMHrzC+mPHcvGRHsO1yCZCoF7GoZb.Uxi6hOAW54DtYfZVhRBB9OJ27ir9XQy.kZNfNWuE7uIBMS8auWuRHYsWaDOn2SOp62S1e+COFu2dXxahhHvSTD9p347Zf6UAlbDYEvDB.FFRpG6gBHDmr7G5wkQ43ZXFa3I.lDpNkCk.+ZdtWQVzdEBCB0pJI0JHLMG51ATaVBnJx7TtI.lYL+hZtQH49QykLiPI8mz16O7ZkrKKlS0VOf2ogguPy7eGoCoS2cy9+8cvD3Mbusu.h7tAirH8ZEozXewIPQP7rbZBusyNs8ZAAsUNUWl68v6TKc2V.Q.BQqIVxkeJqHuauzRDbvLKUR5femnCF9yLUjVqQB0Sw189WT+dajtw6l1GWluXk7Rkg+RoeVd6ciG9eZJJZs1r0WsJNlqWqY6pC8s4nub9rq35NPCCFmVBDNCs5gz6e2Njxxa20.pjijByKS3Ex02xTl0kVInkIacUU4XcsYo1ZfUo5y2RfJFGg290QCoFpcwQgN.WBWaD1r0YH+ivF470HsbGxSu1nRxvVbnFVxZxr9fxkL1IZj.xr64lOci98pk1us+hJger+mriCUJVzeJWLYpotFzmuOC1ppBmGSMqtp0d+RgAn0txNM6dKYpvrn98OeA6eI24qGtqz8gtABCa554ai0vWnC8+MeKtM6AtmEEwYlJx1z872roWc8EPk7seSfUXZALy3d47Yig8MLNvDILIA+PtNMrSu4xDqrsxLlKCyD9K3ovXWqrSgwtkFQynLs5Cr7iH16KuWlFfSxrOanE78KfLtKJaQ.3mKrYEMCtF+CLlsT7Xf6q2mdafO6uA9bvF3ygafOOYC74oafOGcq9X+BpWL2nlkeLATDbV1JKGmyjTXJKahD82PD6Fdg
            

            To go further, you'll need to make an hexadecimal parser. Decompose R, G & B, into decimals, iterate, and parse back to HEX. It's not an easy thing, but I reckon @d-healey made one a while ago...

            I can't help pressing F5 in the forum...

            d.healeyD UrsBollhalderU 2 Replies Last reply Reply Quote 3
            • d.healeyD
              d.healey @ustk
              last edited by

              @ustk Maybe you mean this - https://forum.hise.audio/topic/395/example-of-themed-gui/8?_=1630407614214

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

              ustkU UrsBollhalderU 2 Replies Last reply Reply Quote 3
              • ustkU
                ustk @d.healey
                last edited by

                @d-healey Effectively, that was a while ago :)

                I can't help pressing F5 in the forum...

                UrsBollhalderU 1 Reply Last reply Reply Quote 1
                • UrsBollhalderU
                  UrsBollhalder @ustk
                  last edited by

                  @ustk @d-healey Thanks guys. That’ll keep me busy for a while. A bone to gnaw on…

                  www.ursbollhalder.com
                  www.Instagram.com/urs_bollhalder_composer

                  1 Reply Last reply Reply Quote 1
                  • UrsBollhalderU
                    UrsBollhalder @ustk
                    last edited by

                    @ustk said in Change color in a loop with i-variable?:

                    HiseSnippet 981.3ocsV01aaaCDlxwZnVccXEX+.H5mjSbSncRZyPZPcicxlwVREl65JZQQACEkMQjIEnnamwP9Ou+AaG0KVxqdYoFXBI.5t64N+buviJPqX7zTkF4z5UKR3Hmu1c7BoY5foTgDMZHx4abuflZ3ZbtpSWjPSS4gHGms9AqBmVMQYO+4yOkFSkLdkJD50JAi+yhYBSk1f9+jHN9bZH+UhY0PeP+QLkbfJVMG3yVtDTBkcMcB+RpEVCWjyWcVnvnziMTCOE4z7TU3hwSUeRli+0hTwUwbqPWzXHP4pOWEGZYrUKZvTQbXPYdmhfnDTUE1JuJ7ctWHBEK0WUM91LC3JOpWObZbazq6+M8HqidN0nWyb58P2wLsHwTYwxs66NRBMpHJzBpSqbrnFM2xcfBPHM6NidM+bMHrzC+mPHcvGRHsO1yCZCoF7GoZb.Uxi6hOAW54DtYfZVhRBB9OJ27ir9XQy.kZNfNWuE7uIBMS8auWuRHYsWaDOn2SOp62S1e+COFu2dXxahhHvSTD9p347Zf6UAlbDYEvDB.FFRpG6gBHDmr7G5wkQ43ZXFa3I.lDpNkCk.+ZdtWQVzdEBCB0pJI0JHLMG51ATaVBnJx7TtI.lYL+hZtQH49QykLiPI8mz16O7ZkrKKlS0VOf2ogguPy7eGoCoS2cy9+8cvD3Mbusu.h7tAirH8ZEozXewIPQP7rbZBusyNs8ZAAsUNUWl68v6TKc2V.Q.BQqIVxkeJqHuauzRDbvLKUR5femnCF9yLUjVqQB0Sw189WT+dajtw6l1GWluXk7Rkg+RoeVd6ciG9eZJJZs1r0WsJNlqWqY6pC8s4nub9rq35NPCCFmVBDNCs5gz6e2Njxxa20.pjijByKS3Ex02xTl0kVInkIacUU4XcsYo1ZfUo5y2RfJFGg290QCoFpcwQgN.WBWaD1r0YH+ivF470HsbGxSu1nRxvVbnFVxZxr9fxkL1IZj.xr64lOci98pk1us+hJger+mriCUJVzeJWLYpotFzmuOC1ppBmGSMqtp0d+RgAn0txNM6dKYpvrn98OeA6eI24qGtqz8gtABCa554ai0vWnC8+MeKtM6AtmEEwYlJx1z872roWc8EPk7seSfUXZALy3d47Yig8MLNvDILIA+PtNMrSu4xDqrsxLlKCyD9K3ovXWqrSgwtkFQynLs5Cr7iH16KuWlFfSxrOanE78KfLtKJaQ.3mKrYEMCtF+CLlsT7Xf6q2mdafO6uA9bvF3ygafOOYC74oafOGcq9X+BpWL2nlkeLATDbV1JKGmyjTXJKahD82PD6Fdg

                    Beautiful! A circular gradient!

                    www.ursbollhalder.com
                    www.Instagram.com/urs_bollhalder_composer

                    1 Reply Last reply Reply Quote 0
                    • UrsBollhalderU
                      UrsBollhalder @d.healey
                      last edited by

                      @d-healey said in Change color in a loop with i-variable?:

                      @ustk Maybe you mean this - https://forum.hise.audio/topic/395/example-of-themed-gui/8?_=1630407614214

                      Ingenious!

                      www.ursbollhalder.com
                      www.Instagram.com/urs_bollhalder_composer

                      1 Reply Last reply Reply Quote 0
                      • Christoph HartC
                        Christoph Hart
                        last edited by

                        The days of bit fiddling for color manipulation are over:

                        https://docs.hise.audio/scripting/scripting-api/colours/index.html

                        UrsBollhalderU 2 Replies Last reply Reply Quote 3
                        • UrsBollhalderU
                          UrsBollhalder @Christoph Hart
                          last edited by

                          @Christoph-Hart Awesome. I was just trying to get away from vectors (art of code - trauma 🀣) for a bit, and now you bring the devil into our midst! Awesome! πŸ™

                          www.ursbollhalder.com
                          www.Instagram.com/urs_bollhalder_composer

                          1 Reply Last reply Reply Quote 0
                          • UrsBollhalderU
                            UrsBollhalder @Christoph Hart
                            last edited by

                            @christoph-hart Hey Christoph! Is there an easy way now to draw an Ellipse with a circular gradient, now with the vec4 methods? Linear, no problem, but circular... πŸ™

                            www.ursbollhalder.com
                            www.Instagram.com/urs_bollhalder_composer

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

                            14

                            Online

                            1.2k

                            Users

                            7.9k

                            Topics

                            71.2k

                            Posts