Add This to HISE's API?
-
// Brighten or dim a widget using + or - from 0.0 to 0.1. Unlike the HISE "withBrightness" code, this function can // also increase brightness. The loops are all unrolled in the code here for those who are learning.(Otherwise, // this routine could be done in just a couple lines.) inline function WithSignedBrightness(uint32Colour, brightnessAdjustment) { // Convert the uint32Colour to an array of component floats. local colourArray = Colours.toVec4 (uint32Colour); // Do red. local componentRed = colourArray[0]; componentRed += brightnessAdjustment; if (componentRed < 0.0) componentRed = 0.0; if (componentRed > 1.0) componentRed = 1.0; colourArray[0] = componentRed; // Do blue. local componentBlue = colourArray[1]; componentBlue += brightnessAdjustment; if (componentBlue < 0.0) componentBlue = 0.0; if (componentBlue > 1.0) componentBlue = 1.0; colourArray[1] = componentBlue; // Do green. local componentGreen = colourArray[2]; componentGreen += brightnessAdjustment; if (componentGreen < 0.0) componentGreen = 0.0; if (componentGreen > 1.0) componentGreen = 1.0; colourArray[2] = componentGreen; // Convert the array of floats back into a uint32Colour. local NewColour = Colours.fromVec4(colourArray); // Return our new colour. return NewColour; };
-
@clevername27 withMultipliedBrightness() can make stuff brighter, no?
-