X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fbuilder%2Fbuilder-set-property.cpp;h=93a1fbe8c8d297f582aef51d25ea021158d537c2;hp=d64a04c68fb02fb1a48289120162fb0b66292231;hb=e2916ba0e2e9c92f2254d19f0890589cf77b2221;hpb=5de2b2101d97c968496e77bdb31a561634fd8071 diff --git a/dali-toolkit/internal/builder/builder-set-property.cpp b/dali-toolkit/internal/builder/builder-set-property.cpp index d64a04c..93a1fbe 100644 --- a/dali-toolkit/internal/builder/builder-set-property.cpp +++ b/dali-toolkit/internal/builder/builder-set-property.cpp @@ -19,13 +19,13 @@ #include #include #include -#include // INTERNAL INCLUDES #include #include #include #include +#include namespace Dali { @@ -36,29 +36,6 @@ namespace Toolkit namespace Internal { - -namespace -{ - -/** - * Converts a HTML style 'color' hex string ("#FF0000" for bright red) to a Vector4. - * The Vector4 alpha component will be set to 1.0f - * @param hexString The HTML style hex string - * @return a Vector4 containing the new color value - */ -Vector4 HexStringToVector4( const char* s ) -{ - unsigned int value(0u); - std::istringstream( s ) >> std::hex >> value; - return Vector4( ((value >> 16 ) & 0xff ) / 255.0f, - ((value >> 8 ) & 0xff ) / 255.0f, - (value & 0xff ) / 255.0f, - 1.0f ); -} - -} // anon namespace - - /** * A property value type can be forced when its unknown by a disambiguation convention in the json * ie "myarray": [1,2,3,4] ; would be a vector but @@ -194,17 +171,9 @@ bool DeterminePropertyFromNode( const TreeNode& node, Property::Type type, Prope } else if( OptionalString s = replacer.IsString(node) ) { - if( (*s)[0] == '#' && 7 == (*s).size() ) - { - value = HexStringToVector4( &(*s)[1] ); - done = true; - } - else if( Dali::ColorController::Get() ) - { - Vector4 color; - done = Dali::ColorController::Get().RetrieveColor( *s, color ); - value = color; - } + Vector4 color; + done = ConvertStringToColor( *s, color ); + value = color; } else if( TreeNode::OBJECT == node.GetType() ) {