string $buf[];
string $colstr = `colorEditor`;
tokenize($colstr, $buf);
if($buf[3] == "1")
{
print ("RGB " + $buf[0] + " " + $buf[1] + " " + $buf[2] + "\n");
float $alpha = `colorEditor -q -a`;
print ("Alpha " + $alpha + "\n");
}
色の値を float として扱いたければ、あらためて float の変数に代入するか、以下のように実行する。
colorEditor; // 返り値を無視する。
float $cols[] = `colorEditor -q -rgb`;
print ("RGB " + $cols[0] + " " + $cols[1] + " " + $cols[2] + "\n");
promptDialog;
$ans = `promptDialog -query -text`;