color StringToColor( string color_string // 変換する文字列 );
引数名 | 初期値 | I/O | 詳細 |
color_string | - | In | "R,G,B"形式の文字列または、Webカラー名の文字列 |
#property strict // strictは絶対に削除しない事 void OnInit() { color str_color; str_color=StringToColor("0,127,0"); Print(str_color); Print((string)str_color); printf("0x%06x",str_color); Print("\n"); str_color=StringToColor("0,128,0"); Print(str_color); Print((string)str_color); printf("0x%06x",str_color); Print("\n"); str_color=StringToColor("clrRed"); Print(str_color); Print((string)str_color); printf("0x%06x",str_color); }
0,127,0 0,127,0 0x007f00 clrGreen clrGreen 0x008000 clrRed clrRed 0x0000ff