(AnimatedVectorImageVisual) Change renderer on stage again
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / helpers / color-conversion.h
1 #ifndef DALI_TOOLKIT_INTERNAL_COLOR_CONVERSION_H
2 #define DALI_TOOLKIT_INTERNAL_COLOR_CONVERSION_H
3
4 /*
5  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 // EXTERNAL INCLUDES
21 #include <string>
22 #include <dali/public-api/object/property.h>
23
24 namespace Dali
25 {
26
27 class Vector4;
28
29 namespace Toolkit
30 {
31 namespace Internal
32 {
33
34 /*
35  * @brief Convert the string representation of a color into a Vector4.
36  *
37  * The supported string formats are:
38  * 1) An HTML style 'color' hex string ("#FF0000" for bright red).
39  * 2) An ID referring to the color palette of the current theme e.g. "B018"
40  *
41  * @param[in] colorString The color in string format.
42  * @param[out] outColor The color if found.
43  * @return True if the conversion was successful.
44  */
45 bool ConvertStringToColor( const std::string& colorString, Vector4& outColor );
46
47 /*
48  * @brief Convert a variety of different color representations into a Vector4.
49  *
50  * @param[in] colorValue The color in Vector4 or string format.
51  * @param[out] outColor The color if found.
52  * @return True if the conversion was successful.
53  */
54 bool ConvertPropertyToColor( const Property::Value& colorValue, Vector4& outColor );
55
56 } // Internal
57 } // Toolkit
58 } // Dali
59
60
61 #endif // DALI_TOOLKIT_INTERNAL_COLOR_CONVERSION_H