ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Mapping JSON data to colour ramp in AE

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
aoife mccarthy
Mapping JSON data to colour ramp in AE
on Jun 18, 2020 at 8:48:44 pm

Me again! I'm trying to map values stored in a JSON file to a colour ramp in AE. Something like:

linear(myData.value, 0, value_max, #FFFFFF, #000081)

...in the fill colour property, if the linear expression could be used in this way. So taking a value from my dataset, figuring out where it sits along the colour gradient and applying that fill colour to the shape.

Can anybody help?


Return to posts index

Dan Ebberts
Re: Mapping JSON data to colour ramp in AE
on Jun 18, 2020 at 9:33:32 pm

Just as a test, you could play around with this, to see if it's close to what you want:

s = effect("Slider Control")("Slider");
c1 = hexToRgb("FFFFFFFF");
c2 = hexToRgb("000081FF");
linear(s,0,100,c1,c2)


Dan



Return to posts index

aoife mccarthy
Re: Mapping JSON data to colour ramp in AE
on Jun 19, 2020 at 10:46:52 am

Ahhh I was just missing the hexToRgb expression, popped that in at it works a treat! Thanks for your help!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]