-
CSVs, MOGRTs, and limited colors
Hi there,
I’m currently trying to create a mogrt that the user can select from a limited and specific number of colors for the fill layer. I’ve been trying to see if that would be most efficiently done using a CSV file since that seems to be the way I come across online but I haven’t found a complete answer.
I currently have 5 colors in a csv file called “data-driven.csv” with cells filled appropriately with the hex code I want to use. that file is currently in my comp with a slider control because I want the user to be able to flip between the available colors and that seemed to be the easiest. My shape layer has this expression on it
barColor = thisComp.layer(“data-driven.csv”)(“Data”)(“Outline”)
(“Primary”)(“Primary 0”).toString();
hexToRgb(barColor);
I’m at the point where I know that the value “Primary 0” is what determines which cell the color is trying to look for to fill in the value. what I don’t know is how to link the area where it says “Primary 0” to the slider so that if I set the slider to 1, it’ll choose “Primary 0” of the csv file and if I set the slider to 3, it’ll choose “Primary 2” as so forth. it’s frustrating being so close to what I want to accomplish and still not there since I have not seen the full solution/explanation online.
thanks in advance for any help