How to get the fill color of a vector or mask in scripting?
Hello all. Recently made myself an ActionReference translator that essentially creates a simplified object of a given layer to make it much easier (in my opinion) to work with. As far as I can tell, it works for everything but in using it for a given vector I get results like this:
{
"layer": "test",
"color": "none",
"visible": true,
"mode": "normal",
"opacity": 255,
"layerID": 18,
"itemIndex": 2,
"count": 2,
"preserveTransparency": false,
"layerFXVisible": false,
"globalAngle": 90,
"background": false,
"layerSection": 4187,
"layerLocking": {
"protectTransparency": false,
"protectComposite": false,
"protectPosition": false,
"protectArtboardAutonest": false,
"protectAll": false
},
"group": false,
"targetChannels": { "count": 3, "typename": "ActionList" },
"visibleChannels": { "count": 3, "typename": "ActionList" },
"channelRestrictions": { "count": 3, "typename": "ActionList" },
"fillOpacity": 255,
"hasUserMask": false,
"hasVectorMask": true,
"proportionalScaling": false,
"layerKind": 4,
"hasFilterMask": false,
"userMaskDensity": 255,
"userMaskFeather": 0,
"vectorMaskDensity": 255,
"vectorMaskFeather": 0,
"adjustment": { "count": 1, "typename": "ActionList" },
"bounds": {
"top": 300,
"left": 300,
"bottom": 500,
"right": 500,
"width": 200,
"height": 200
},
"boundsNoEffects": {
"top": 300,
"left": 300,
"bottom": 500,
"right": 500,
"width": 200,
"height": 200
},
"boundsNoMask": {
"top": 0,
"left": 0,
"bottom": 1000,
"right": 1500,
"width": 1500,
"height": 1000
},
"pathBounds": {
"pathBounds": {
"top": 300,
"left": 300,
"bottom": 500,
"right": 500
}
},
"useAlignedRendering": true,
"generatorSettings": {},
"AGMStrokeStyleInfo": {
"strokeStyleVersion": 2,
"strokeEnabled": true,
"fillEnabled": true,
"strokeStyleLineWidth": 20,
"strokeStyleLineDashOffset": 0,
"strokeStyleMiterLimit": 100,
"strokeStyleLineCapType": 2332,
"strokeStyleLineJoinType": 2336,
"strokeStyleLineAlignment": 2339,
"strokeStyleScaleLock": false,
"strokeStyleStrokeAdjust": false,
"strokeStyleLineDashSet": { "count": 0, "typename": "ActionList" },
"strokeStyleBlendMode": "normal",
"strokeStyleOpacity": 100,
"strokeStyleContent": {
"color": "RGBColor(255,0,0)"
},
"strokeStyleResolution": 72
},
"keyOriginType": { "count": 1, "typename": "ActionList" },
"fillEnabled": true,
"animationProtection": {
"animationUnifyPosition": false,
"animationUnifyEffects": false,
"animationUnifyVisibility": false,
"animationPropagate": true
},
"artboard": {
"artboardRect": {
"top": 0,
"left": 0,
"bottom": 0,
"right": 0
},
"guideIDs": { "count": 0, "typename": "ActionList" },
"artboardPresetName": "",
"color": "RGBColor(255,255,255)",
"artboardBackgroundType": 1
},
"artboardEnabled": false,
"vectorMaskEnabled": true,
"vectorMaskEmpty": false,
"textWarningLevel": 0
}Noticeably it doesn't provide the fill color. I have a green rectangle with a red stroke in PS, but it I don't see any green color value here. The "color" StringID of a layer ActionReference always returns "none" even before I create a readable string format. There's a clear key object for the stroke, but nothing for a fill?
Just to be clear, I'm not looking to create a fill on a vector -- I'm trying to read the current fill of a given vector. Does any one have the charID chain to access this info? Is the issue in my translating function missing keys, or is there any other way to do this?
Thanks!
