Add post processor
[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) 2021 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 <dali/public-api/object/property.h>
22 #include <string>
23
24 namespace Dali
25 {
26 struct Vector4;
27
28 namespace Toolkit
29 {
30 namespace Internal
31 {
32 /*
33  * @brief Convert the string representation of a color into a Vector4.
34  *
35  * The supported string formats are:
36  * 1) An HTML style 'color' hex string ("#FF0000" for bright red).
37  * 2) An ID referring to the color palette of the current theme e.g. "B018"
38  *
39  * @param[in] colorString The color in string format.
40  * @param[out] outColor The color if found.
41  * @return True if the conversion was successful.
42  */
43 bool ConvertStringToColor(const std::string& colorString, Vector4& outColor);
44
45 /*
46  * @brief Convert a variety of different color representations into a Vector4.
47  *
48  * @param[in] colorValue The color in Vector4 or string format.
49  * @param[out] outColor The color if found.
50  * @return True if the conversion was successful.
51  */
52 bool ConvertPropertyToColor(const Property::Value& colorValue, Vector4& outColor);
53
54 } // namespace Internal
55 } // namespace Toolkit
56 } // namespace Dali
57
58 #endif // DALI_TOOLKIT_INTERNAL_COLOR_CONVERSION_H