Now, here is my code.
// edit_pal_red(+/-) - Edits the red value.
var i, t;
if blending=0 {t=pal[palx,paly]; i=string_char_at(pal[palx,paly],4);}
else {t=palab; i=string_char_at(palab,4);}
// Convert the necessary hex digit to decimal.
i=hex_to_dec(i);
// Now, we need to modify it by adding/subtracting 2. A wrap is necessary for subtraction.
if argument0=0 {i+=2;} if argument0=1 {if i>0 i-=2; else i=14;}
// Now, convert it back to hex again, using the second hex character. Through this, 16 can be reset to 0 whilst adding.
i = string_char_at(dec_to_hex(i),2);
// Return the modified hex value, set into the table.
if blending=0 {pal[palx,paly]="0"+string_char_at(t,2)+string_char_at(t,3)+i; pcol[palx,paly]=draw_hex_color(pal[palx,paly]);}
else {palab="0"+string_char_at(t,2)+string_char_at(t,3)+i; abcol=draw_hex_color(palab);}The problem lies in the line "if argument0=0 {i+=2;} if argument0=1 {if i>0 i-=2; else i=14;}" It is supposed to add/subtract the aforementioned value to i. But it doesn't. I removed the add/subtract stuff to make it set i to either 2 or 14. That works no problem, and the color changes. But when I add the adding and subtracting back in, it fails.
Any insight as to why?











