diff --git a/StringUtils3d.cpp b/StringUtils3d.cpp index 1b357f7..d817110 100644 --- a/StringUtils3d.cpp +++ b/StringUtils3d.cpp @@ -76,11 +76,18 @@ FromString( const string& sVal, Frame3d& frFrame) bool FromString( const string& sVal, Color& cCol) { - // devono essere 4 parametri : Red, Green, Blue, Alpha - int vnVal[4] ; - if ( ! FromString( sVal, vnVal)) - return false ; - // assegno il colore - cCol.Set( vnVal[0], vnVal[1], vnVal[2], vnVal[3]) ; - return true ; + // dovrebbero essere 4 parametri : Red, Green, Blue, Alpha + int vnRGBA[4] ; + if ( FromString( sVal, vnRGBA)) { + cCol.Set( vnRGBA[0], vnRGBA[1], vnRGBA[2], vnRGBA[3]) ; + return true ; + } + // riprovo con 3 parametri : Red, Green, Blue + int vnRGB[3] ; + if ( FromString( sVal, vnRGB)) { + cCol.Set( vnRGB[0], vnRGB[1], vnRGB[2]) ; + return true ; + } + // altrimenti errore + return false ; }