allow omitting alpha from "1,1,1", like #FFFFFF
This commit is contained in:
@@ -140,6 +140,11 @@ public:
|
|||||||
bool FromString( const CString &str )
|
bool FromString( const CString &str )
|
||||||
{
|
{
|
||||||
int result = sscanf( str, "%f,%f,%f,%f", &r, &g, &b, &a );
|
int result = sscanf( str, "%f,%f,%f,%f", &r, &g, &b, &a );
|
||||||
|
if( result == 3 )
|
||||||
|
{
|
||||||
|
a = 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if( result == 4 )
|
if( result == 4 )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user