2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 /// A class encapsulating the property map of the color visual.
23 /// <since_tizen> 3 </since_tizen>
24 public class ColorVisual : VisualMap
26 private Color _mixColorForColorVisual = null;
27 private bool? _renderIfTransparent = false;
32 /// <since_tizen> 3 </since_tizen>
33 public ColorVisual() : base()
38 /// Gets or sets the solid color required.<br />
41 /// <since_tizen> 3 </since_tizen>
46 return _mixColorForColorVisual;
50 _mixColorForColorVisual = value;
56 /// Gets or sets whether to render if the MixColor is transparent.
57 /// By default it is false, which means that the ColorVisual will not render if the MIX_COLOR is transparent.
59 /// <since_tizen> 5 </since_tizen>
60 public bool RenderIfTransparent
64 return _renderIfTransparent ?? (false);
68 _renderIfTransparent = value;
74 /// Compose the out visual map.
76 /// <since_tizen> 3 </since_tizen>
77 protected override void ComposingPropertyMap()
79 Color color = _mixColorForColorVisual ?? _mixColor;
83 _outputVisualMap = null;
85 base.ComposingPropertyMap();
87 _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
88 _outputVisualMap.Add(ColorVisualProperty.MixColor, new PropertyValue(color));
92 _outputVisualMap = new PropertyMap();