This commit is contained in:
2026-01-13 22:17:38 -06:00
parent ea3499db51
commit 8c0c768b01

View File

@@ -70,10 +70,10 @@ JSValue js_aseprite_decode(JSContext *js, JSValue this_val, int argc, JSValueCon
JSValue palette_array = JS_NewArray(js); JSValue palette_array = JS_NewArray(js);
for (int i = 0; i < ase->palette.entry_count; i++) { for (int i = 0; i < ase->palette.entry_count; i++) {
JSValue color = JS_NewObject(js); JSValue color = JS_NewObject(js);
JS_SetPropertyUint32(js, color, 0, JS_NewUint32(js, ase->palette.entries[i].color.r)); JS_SetPropertyStr(js, color, "r", JS_NewUint32(js, ase->palette.entries[i].color.r));
JS_SetPropertyUint32(js, color, 1, JS_NewUint32(js, ase->palette.entries[i].color.g)); JS_SetPropertyStr(js, color, "g", JS_NewUint32(js, ase->palette.entries[i].color.g));
JS_SetPropertyUint32(js, color, 2, JS_NewUint32(js, ase->palette.entries[i].color.b)); JS_SetPropertyStr(js, color, "b", JS_NewUint32(js, ase->palette.entries[i].color.b));
JS_SetPropertyUint32(js, color, 3, JS_NewUint32(js, ase->palette.entries[i].color.a)); JS_SetPropertyStr(js, color, "a", JS_NewUint32(js, ase->palette.entries[i].color.a));
JS_SetPropertyUint32(js, palette_array, i, color); JS_SetPropertyUint32(js, palette_array, i, color);
} }
JS_SetPropertyStr(js, result, "palette", palette_array); JS_SetPropertyStr(js, result, "palette", palette_array);