I'm trying to make lower thirds that can be changed to colors from a specific color palette through a slider. For example if there were ten colors, the slider would be clamped to 1-10. And each number on the slider would correspond to a specific color number, example color #149bf4 (light blue) is always 1, color #2decdb (cyan) is always 2, etc. What would an expression for that look like? My gut says setting a color value to some sort of position value, but I can wrap my head around that completely.
I'm trying to make this in after effects so I can have a fully customizable and on-brand lower third in essential graphics. I figured out the other parts such as adjustable text and automatic resizing, this would the last piece of the puzzle.
var r = theHex >> 16;
var g = (theHex & 0x00ff00) >> 8;
var b = theHex & 0xff;
s = Math.round(effect("Slider Control")("Slider"));
colors = [0x149bf4,0x2decdb];
idx = clamp(s-1,0,colors.length-1);
c = colors[idx];