@@ -112,6 +112,16 @@ namespace FlaxEngine
|
||||
/// </summary>
|
||||
public float ValuesSum => R + G + B + A;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if color is fully transparent (all components are equal zero).
|
||||
/// </summary>
|
||||
public bool IsTransparent => Mathf.IsZero(R + G + B + A);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if color has opacity channel in use (different from 1).
|
||||
/// </summary>
|
||||
public bool HasOpacity => !Mathf.IsOne(A);
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new Color with given r,g,b,a component.
|
||||
/// </summary>
|
||||
|
||||
@@ -595,7 +595,7 @@ namespace FlaxEngine.GUI
|
||||
Size = new Float2(size.X - margin, size.Y),
|
||||
Font = Font,
|
||||
TextColor = TextColor * 0.9f,
|
||||
TextColorHighlighted = BackgroundColorSelected.Brightness < 0.05f ? Color.Lerp(TextColorHighlighted, Color.White, 0.3f) : TextColorHighlighted,
|
||||
TextColorHighlighted = (Mathf.IsZero(BackgroundColorSelected.Brightness) || BackgroundColorSelected.IsTransparent) ? Color.Lerp(TextColorHighlighted, Color.White, 0.3f) : TextColorHighlighted,
|
||||
HorizontalAlignment = HorizontalAlignment,
|
||||
VerticalAlignment = VerticalAlignment,
|
||||
Text = _items[i],
|
||||
|
||||
Reference in New Issue
Block a user