How to change textColour dynamically?
-
I would like to change the value of textColour dynamically, what am I doing wrong?
inline function onknbControl(component, value) { FX.setAttribute(FX.fxParameter, value); if (value < -22) // this is the value in dB { knb.set("textColour", "#FFFFFFFF"); } if (value >= -22) { knb.set("textColour", "#FF424242"); } }; Content.getComponent("knb").setControlCallback(onknbControl);
If I use a syntax like this, HISE slows down to the point of crashing
knb.set("textColour", 0xFF424242);
-
@Mighty23 perhaps try it with local LAF?
-
@Lindon said in How to change textColour dynamically?:
try it with local LAF?
HiseSnippet 1243.3ocsVrsaaTDc1jrEhAJTDe.ixSqCtN1NNwsJTZZtXvpIoV0oQHEEpFuyrdG7tyXs63jXPUhW4S.9D3Of25mD+AvYlYs85FSRqkXsk8dteYNWl1IReVZpLA4T3zQCXHmO0syHgJb+PBWfZc.x49tGSRUrDrE0diFPRSYTjiyxemFgypqfLO+8S2iDQD9ronPnyjbe1Q7XtZJ1169bdTTSBkcJONG202skuTruLRND7mkcqfFP76S5wNgnYaIWz2SRCQNq693s1pJgFzHn5lUebWZfOayFU1tdiZjsdTPPiJUquIsQPcvIu2gTtRlzQQTrTPo6Ioi5DJuRXMvY7Td2HlFnJpCXYKZz9g7HZ6wImTDxYk1SSUKaSUek6wbJeB9ooruvP.OUh7IMmktMWp5GfK4jykVw5ROvsieBefZJEs+7ItsDvIX.ANax6JVdQK8aq3tuD3PnJGS5yZl..Sjva6JUJggeJtSgBv4SpBeIIA+bgraU7SviErGSsuLdfT..dqYntlVhLQ5K5FQBNikn39jnbx4mvf7vQR.6QRY+mInMYrHOPzYEobBqGWWG1bnvWwkBu0nIjqNhKXjjNQbJKYsR3fwD6UBK69SEK7KEvvi1gIfQATkIfA2YB1PhfFw.Rjy27hM1dJAAfySiD+vLlJh2vvkkmILdIv3wDUHj5t1CxT124BupkvdUKWAjWa1KIQCYmHShIQ7elQKVrHdcrHmt1XCb2dl25UNUmL0sAdZQ61yBTbmLxAP6yKkCETF8kLeEQzKh4QJAdWsKVuR4sJNqZ0rynXcfeC8a+KsbDuWnpWBazsajyg.rh0PkLIi0uD+0Y4mKl0AFacKw+SCeUHGZChk8Y2sksFbr4mqUyE1oPO0orqU6IuFySwGJHPaE0RccyelpTck6Y5CGuL44AXOyoE9avOrVshFkoBAU.eUgLrkHWfo6YDvViAkq5vyaMEXSazAEjUtto8IS4u4cLw29DiMduzS8Z5Oynn02vFxuQ2pYCGP1azMMaqTwcF2lfkhSjJ1KDd5NkUK.J8cIEDLWZ512DITWkLWx5A6I2lfdhgwcYIkrIyILBCxlc538d+lN5amljiQonkfqdw.VFbSYDUO0S+9MmkhxFGompl4g.qJyL06mMS0NjAwAk7QtlbMx374W2gdUqCHJxX0.ZDrx.cdWGLNGvtDVGZGUup6Arz9J4.CuYSNQNe9cZzqmZveb2QS.90y2MUMRmZJ3N9jFEyoPORaYJWm9mJXs2BiRGzAlDow8G+t94udZb904m7VXfV9XKcXP.Gv35BE9HnIMNUAtXqXXCMx4KceUJCSYAjgQJbZePUQbQeF8ToY0crjlEz97trHzUbpB1k653ApNjoG+ng9SyEDtwdMXipjNLhnlcMq9BHYDzgW9ca58WBHrGk+BJe.6dqbq6deecwG31lq7CmuOtzb7Qnx4+CeL6FKel6gAAvH0oN3JtM+gE85I2g4gQ3JtnGrOLwT1bxv3NvvLeFXcgfEkpOuWR26Ygqng0YfNLA0.7OvSFwpZXmLhUGSDES7Sju121wpuSzGav.9jvbmwUgKuBv34zpBsF7W66Oqptgf0VTA2bQEr9hJ3VKpfaunB1XQE7Q2sf5aP+rgJYrssAgNt8glQqNNYax0Uqn+EpVlhbC
Thanks for replying.
I've already tried but I can't get it to work with the texts in "showTextBox" -
HiseSnippet 1121.3ocsVsraabCEkirF2X0Gnona5NBsRtvUQRV1VsoE9oTiPrcDrbBRVYPQxQhUbHElgisUKxGRJ5h9azc9CoeDceW3dImQVihcZJLZlEB3x6Cd3g2ykpWjlxii0QHuRmNcBG48I98mpLi1eDQnPcO.48.+yZeTuSeEZuoSHwwbFxyaoez50akhH22es8dDIQ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cJfill+ws+2lU+eEhOzumvPGc2XrvcfQnE6CAFydg6S8aGD.yUmCvh9cd4GlmyPmnSLB0viHPGlsk63jv9vMMkC6tRwkVouWAqHM0tl01x.84Jly3Z3KyYcqsWly5ybBsZzH8YzTos8MzG3VAvjx8+MVw+HqMdQMs6CzQhynzEK0sRrw8Mw0uuI179l3F22D279l3V22Da89Sz9Ot1MwnCSkMHzQ8Z6lA640VQfNPW2J5erdbZrI
-
@Mighty23 said in How to change textColour dynamically?:
HiseSnippet 1243.3ocsVrsaaTDc1jrEhAJTDe.ixSqCtN1NNwsJTZZtXvpIoV0oQHEEpFuyrdG7tyXs63jXPUhW4S.9D3Of25mD+AvYlYs85FSRqkXsk8dteYNWl1IReVZpLA4T3zQCXHmO0syHgJb+PBWfZc.x49tGSRUrDrE0diFPRSYTjiyxemFgypqfLO+8S2iDQD9ronPnyjbe1Q7XtZJ1169bdTTSBkcJONG202skuTruLRND7mkcqfFP76S5wNgnYaIWz2SRCQNq693s1pJgFzHn5lUebWZfOayFU1tdiZjsdTPPiJUquIsQPcvIu2gTtRlzQQTrTPo6Ioi5DJuRXMvY7Td2HlFnJpCXYKZz9g7HZ6wImTDxYk1SSUKaSUek6wbJeB9ooruvP.OUh7IMmktMWp5GfK4jykVw5ROvsieBefZJEs+7ItsDvIX.ANax6JVdQK8aq3tuD3PnJGS5yZl..Sjva6JUJggeJtSgBv4SpBeIIA+bgraU7SviErGSsuLdfT..dqYntlVhLQ5K5FQBNikn39jnbx4mvf7vQR.6QRY+mInMYrHOPzYEobBqGWWG1bnvWwkBu0nIjqNhKXjjNQbJKYsR3fwD6UBK69SEK7KEvvi1gIfQATkIfA2YB1PhfFw.Rjy27hM1dJAAfySiD+vLlJh2vvkkmILdIv3wDUHj5t1CxT124BupkvdUKWAjWa1KIQCYmHShIQ7elQKVrHdcrHmt1XCb2dl25UNUmL0sAdZQ61yBTbmLxAP6yKkCETF8kLeEQzKh4QJAdWsKVuR4sJNqZ0rynXcfeC8a+KsbD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