parseColorStr

T[4]
parseColorStr
(
T = float
)
(
string cstr
,
real norm = 1
)

Examples

1 assert( [1.0f,0,1,0] == parseColorStr( "#FF00FF00" ) );
2 assert( [1.0f,0,1,1] == parseColorStr( "#FF00FF" ) );
3 assert( [1.0f,0,1,0] == parseColorStr( "#F0F0" ) );
4 assert( [1.0f,0,1,1] == parseColorStr( "#F0F" ) );
5 assert( [1.0f,1,1,0] == parseColorStr( "#F0" ) );
6 assert( [1.0f,1,1,1] == parseColorStr( "#F" ) );
7 assert( [0.0f,0,0,1] == parseColorStr( "#0" ) );
8 assert( [1.0f,1,1,1] == parseColorStr( "0xF" ) );
9 assert( [0.0f,0,0,1] == parseColorStr( "0x0" ) );
10 
11 assert( [255,15,255,255] == parseColorStr!ubyte( "#FF0FFF", 255 ) );

Meta