// post("preset_color pattr object found and subscribed to bound pattrstorage. Switching to color mode", color_mode_candidate, '\n');
is_listening_to_subscriptionlist=0;
color_mode=color_mode_candidate;
paint_base();
}elseif(client=="done"){
error("A [pattr preset_color] object has been found but it isn't subscribed to your pattrstorage. Please add it to your subscribelist and try changing color mode again.\n")
is_listening_to_subscriptionlist=0;
}
}
}
functionclientlist(){
varclient=arrayfromargs(arguments)[0];
if(is_listening_to_clientlist){
if(client=="preset_color"){
// post("preset_color pattr object found and client to bound pattrstorage. Switching to color mode", color_mode_candidate, '\n');
is_listening_to_clientlist=0;
color_mode=color_mode_candidate;
paint_base();
}elseif(client=="done"){
error("A [pattr preset_color] object has been found but seems to be invisible to the pattrstorage.\n")
is_listening_to_clientlist=0;
}
}
}
functionresync(){
functionresync(){
set_active_slot(0);
set_active_slot(0);
slots_clear();
slots_clear();
@ -1561,13 +1604,35 @@ function getcolor_mode() {
returncolor_mode;
returncolor_mode;
}
}
functionsetcolor_mode(v){
functionsetcolor_mode(v){
if(v>0){
v=Math.floor(v);
color_mode=Math.floor(v);
v=Math.max(0,Math.min(3,v));
// For color modes 2 and 3 (free and custom),
// we need to ensure there's a [pattr preset_color] somewhere to store the preset color