1 #ifndef DALI_TOOLKIT_INTERNAL_COLOR_CONVERSION_H
2 #define DALI_TOOLKIT_INTERNAL_COLOR_CONVERSION_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include <dali/public-api/object/property.h>
33 * @brief Convert the string representation of a color into a Vector4.
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"
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.
43 bool ConvertStringToColor(const std::string& colorString, Vector4& outColor);
46 * @brief Convert a variety of different color representations into a Vector4.
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.
52 bool ConvertPropertyToColor(const Property::Value& colorValue, Vector4& outColor);
54 } // namespace Internal
55 } // namespace Toolkit
58 #endif // DALI_TOOLKIT_INTERNAL_COLOR_CONVERSION_H