* Remove UIColor constructor with vector4 type.
* Add predefined colors: Yellow, Cyan, Magenta, Gray
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
public static UIColor TextColor(this TextEditor view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.TextColor);
+ return UIColor.From(view.TextColor);
}
/// <summary>
public static UIColor PlaceholderTextColor(this TextEditor view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.PlaceholderTextColor);
+ return UIColor.From(view.PlaceholderTextColor);
}
/// <summary>
public static UIColor PrimaryCursorColor(this TextEditor view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.PrimaryCursorColor);
+ return UIColor.From(view.PrimaryCursorColor);
}
/// <summary>
public static UIColor SecondaryCursorColor(this TextEditor view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.SecondaryCursorColor);
+ return UIColor.From(view.SecondaryCursorColor);
}
/// <summary>
public static UIColor SelectionHighlightColor(this TextEditor view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.SelectionHighlightColor);
+ return UIColor.From(view.SelectionHighlightColor);
}
/// <summary>
public static UIColor InputColor(this TextEditor view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.InputColor);
+ return UIColor.From(view.InputColor);
}
}
}
public static UIColor TextColor(this TextField view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.TextColor);
+ return UIColor.From(view.TextColor);
}
/// <summary>
public static UIColor PlaceholderTextColor(this TextField view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.PlaceholderTextColor);
+ return UIColor.From(view.PlaceholderTextColor);
}
/// <summary>
public static UIColor PrimaryCursorColor(this TextField view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.PrimaryCursorColor);
+ return UIColor.From(view.PrimaryCursorColor);
}
/// <summary>
public static UIColor SecondaryCursorColor(this TextField view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.SecondaryCursorColor);
+ return UIColor.From(view.SecondaryCursorColor);
}
/// <summary>
public static UIColor SelectionHighlightColor(this TextField view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.SelectionHighlightColor);
+ return UIColor.From(view.SelectionHighlightColor);
}
/// <summary>
public static UIColor InputColor(this TextField view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.InputColor);
+ return UIColor.From(view.InputColor);
}
}
}
public static UIColor TextColor(this TextLabel view)
{
//FIXME: we need to set UI value type directly without converting reference value.
- return new UIColor(view.TextColor);
+ return UIColor.From(view.TextColor);
}
}
}
var color = view.Color;
//FIXME: we need to set UI value type directly without converting reference value.
- return color != null ? new UIColor(color) : UIColor.Transparent;
+ return color != null ? UIColor.From(color) : UIColor.Transparent;
}
/// <summary>
var color = view.BorderlineColor;
//FIXME: we need to set UI value type directly without converting reference value.
- return color != null ? new UIColor(color) : UIColor.Transparent;
+ return color != null ? UIColor.From(color) : UIColor.Transparent;
}
}
}
/// </summary>
public static readonly UIColor White = new (1, 1, 1, 1);
+ /// <summary>
+ /// The gray color.
+ /// </summary>
+ public static readonly UIColor Gray = new (0.5f, 0.5f, 0.5f, 1);
+
/// <summary>
/// The red color.
/// </summary>
/// </summary>
public static readonly UIColor Blue = new (0, 0, 1, 1);
+ /// <summary>
+ /// The yellow color.
+ /// </summary>
+ public static readonly UIColor Yellow = new (1, 1, 0, 1);
+
+ /// <summary>
+ /// The cyan color.
+ /// </summary>
+ public static readonly UIColor Cyan = new (0, 1, 1, 1);
+
+ /// <summary>
+ /// The magenta color.
+ /// </summary>
+ public static readonly UIColor Magenta = new (1, 0, 1, 1);
+
private float _r; // multiply alpha for token
private float _g; // fixed alpha for token
private float _b;
_tokenId = tokenId;
}
- internal UIColor(NUI.Vector4 vector4) : this(vector4.X, vector4.Y, vector4.Z, vector4.W)
- {
- }
-
/// <summary>
/// Gets a value indicating whether this is default.
/// </summary>
/// <param name="id">The unique identifier of the token.</param>
public static UIColor Token(string id) => new (id, 1f);
+ internal static UIColor From(NUI.Vector4 vector4) => new UIColor(vector4.X, vector4.Y, vector4.Z, vector4.W);
+
/// <summary>
/// Compares two UIColor for equality.
/// </summary>
vector4.Reset();
_ = Interop.View.InternalRetrievingVisualPropertyVector4(actor, visualIndex, visualPropertyIndex, vector4.SwigCPtr);
NDalicPINVOKE.ThrowExceptionIfExists();
- return new UIColor(vector4);
+ return UIColor.From(vector4);
}, actor, visualIndex, visualPropertyIndex);
}
var shadow = new Shadow(map);
return new UIShadow()
{
- Color = new UIColor(shadow.Color),
+ Color = UIColor.From(shadow.Color),
BlurRadius = shadow.BlurRadius,
OffsetX = shadow.Offset.X,
OffsetY = shadow.Offset.Y,