mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-20 06:47:44 +01:00
Fix RGB returning wrong color and change it to RGBA (#1793)
* FIx RGB returning wrong color and change it to RGBA * Don't use the old RGB variable * Fix UIGlowPayload too * Add RGBA to ABGR helper and new method for glow/foreground to expose it directly * Move from Utils to ColorHelpers * Rename the function
This commit is contained in:
parent
d2a0c94ddd
commit
44a3c3a1ee
4 changed files with 44 additions and 21 deletions
|
|
@ -77,15 +77,21 @@ public class UIForegroundPayload : Payload
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Red/Green/Blue values for this foreground color, encoded as a typical hex color.
|
||||
/// Gets the Red/Green/Blue/Alpha values for this foreground color, encoded as a typical hex color.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public uint RGB => this.UIColor.UIForeground & 0xFFFFFF;
|
||||
public uint RGBA => this.UIColor.UIForeground;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ABGR value for this foreground color, as ImGui requires it in PushColor.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public uint ABGR => Interface.ColorHelpers.SwapEndianness(this.UIColor.UIForeground);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.Type} - UIColor: {this.colorKey} color: {(this.IsEnabled ? this.RGB : 0)}";
|
||||
return $"{this.Type} - UIColor: {this.colorKey} color: {(this.IsEnabled ? this.RGBA : 0)}";
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
|
|
@ -68,10 +68,16 @@ public class UIGlowPayload : Payload
|
|||
public bool IsEnabled => this.ColorKey != 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Red/Green/Blue values for this glow color, encoded as a typical hex color.
|
||||
/// Gets the Red/Green/Blue/Alpha values for this glow color, encoded as a typical hex color.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public uint RGB => this.UIColor.UIGlow & 0xFFFFFF;
|
||||
public uint RGBA => this.UIColor.UIGlow;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ABGR value for this glow color, as ImGui requires it in PushColor.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public uint ABGR => Interface.ColorHelpers.SwapEndianness(this.UIColor.UIGlow);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a Lumina UIColor object representing this payload. The actual color data is at UIColor.UIGlow.
|
||||
|
|
@ -85,7 +91,7 @@ public class UIGlowPayload : Payload
|
|||
/// <inheritdoc/>
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{this.Type} - UIColor: {this.colorKey} color: {(this.IsEnabled ? this.RGB : 0)}";
|
||||
return $"{this.Type} - UIColor: {this.colorKey} color: {(this.IsEnabled ? this.RGBA : 0)}";
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue