How to change text layer color and shape layer background color with json?
vimaloneuser opened this issue · 3 comments
I want to change the font color of THE WEDDING and I want to change the background color of Shape Layer 4 so I have tried with the below type of JSON but none of these are working.
"assets": [
{
"type": "data",
"layerName": "THE WEDDING",
"property": "Color",
"value": [1.0, 0.5, 0, 0]
}
{
"type": "data",
"layerName": "Shape Layer 4",
"property": "Color",
"value": [1.0, 0.5, 0, 0]
}
]
Error: Error: nexrender: Can't find a property sequence Color for key: Colorwithin layer: Shape Layer 4
"assets": [
{
"type": "data",
"layerName": "THE WEDDING",
"property": "Effects.Skin_Color.Color",
"value": [1, 0, 0]
}
{
"type": "data",
"layerName": "Shape Layer 4",
"property": "Effects.Skin_Color.Color",
"value": [1, 0, 0]
}
]
Error: Error: Error: nexrender: Can't find a property sequence Color for key: Effects.Skin_Color.Color layer: Shape Layer 4
Can anyone help here?
For the shape Layer, you need to provide the path of the property, it should be something like :
Contents.Rectangle 1.Fill.Color
assuming your shape is a Rectangle.
For the text, the color is not accessible with a simple property.
I see two options, First you replace the value in your JSON with an expression to set the text style:
{ "type": "data", "layerName": "THE WEDDING", "property": "Text.Source Text", "expression": "let style = text.sourceText.style..setFillColor([1,0,0]);" },
Option 2 : you add a Color Control and use an expression on the Text to set the color using the Color Control, and in your JSON, you set Color Control itself.
expression on text : let style = text.sourceText.style; let color = effect("Color Control")("Color"); style.setFillColor(color);
JSON
{ "type": "data", "layerName": "THE WEDDING", "property": "Color Control..Color", "value": [1, 0, 0] }
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.