Files
armorpaint/base/assets/plugins/export_gpl.js
T
luboslenco 4cc4b0d069 Cleanup
2024-11-08 23:46:39 +01:00

25 lines
623 B
JavaScript

function export_gpl(path, name, swatches) {
let o: string = "";
o += "GIMP Palette\n";
o += "Name: " + name + "\n";
o += "# armorpaint.org\n";
o += "#\n";
for (let i = 0; i < swatches.length; ++i) {
let swatch = swatches[i];
let rb = color_get_rb(swatch.base);
let gb = color_get_gb(swatch.base);
let bb = color_get_bb(swatch.base);
o += rb + " " + gb + " " + bb + "\n";
}
iron_file_save_bytes(path, sys_string_to_buffer(o), o.length);
}
let plugin = plugin_create();
path_swatch_exporters_set("gpl", export_gpl);
plugin_notify_on_delete(plugin, function() {
path_swatch_exporters_delete("gpl");
});