REM "Converts #FFFFFF to 255,255,255";
R1 := @uppercase(@Right(@Left(hex;2);1));
R2 := @uppercase(@Right(@Left(hex;3);1));
G1 := @uppercase(@Right(@Left(hex;4);1));
G2 := @uppercase(@Right(@Left(hex;5);1));
B1 := @uppercase(@Right(@Left(hex;6);1));
B2 := @uppercase(@Right(hex;1));
alpha := "0" : "1" : "2" : "3" : "4" : "5" : "6" : "7" : "8" : "9" : "A" : "B" : "C" : "D" : "E" : "F" ;
numeric := "0" : "1" : "2" : "3" : "4" : "5" : "6" : "7" : "8" : "9" : "10" : "11" : "12" : "13" : "14" : "15" ;
R1 := @Replace(R1; alpha ; numeric );
R2 := @Replace(R2; alpha ; numeric );
G1 := @Replace(G1; alpha ; numeric );
G2 := @Replace(G2; alpha ; numeric );
B1 := @Replace(B1; alpha ; numeric );
B2 := @Replace(B2; alpha ; numeric );
R := @Text((@TextToNumber(R1)*16)+(@TextToNumber(R2)));
G := @Text((@TextToNumber(G1)*16)+(@TextToNumber(G2)));
B := @Text((@TextToNumber(B1)*16)+(@TextToNumber(B2)));