当我选择颜色时,我从颜色选择器返回这些数据:
{
"_originalInput”: {
"h": "0%",
"s": "0%",
"v": "100%",
"a": 0
},
"_r": 255,
"_g": 255,
"_b": 255,
"_a": 0,
"_roundA": 0,
"_format": "hex",
"_ok": true,
"_tc_id":248
}
Run Code Online (Sandbox Code Playgroud)
我需要访问价值,a但我被卡住了.我试过了:
var theCol = JSON.stringify(tinyColor); // strigify it to see it
alert(theCol); // show me it
var a = tinyColor[\'a\’]; // get value of a from array
alert(a); // alert a
Run Code Online (Sandbox Code Playgroud)
任何帮助访问a都会很棒,感谢学习社区.