adjust colors

This commit is contained in:
azyges
2025-08-29 09:23:51 +09:00
parent 44475fda50
commit 9c0379631f
13 changed files with 68 additions and 34 deletions

View File

@@ -63,7 +63,7 @@ internal sealed partial class CharaDataHubUi
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted("GPose Lobby");
ImGui.SameLine();
UiSharedService.ColorTextWrapped(_charaDataGposeTogetherManager.CurrentGPoseLobbyId, ImGuiColors.ParsedGreen);
UiSharedService.ColorTextWrapped(_charaDataGposeTogetherManager.CurrentGPoseLobbyId, UIColors.Get("LightlessBlue"));
ImGui.SameLine();
if (_uiSharedService.IconButton(FontAwesomeIcon.Clipboard))
{
@@ -130,7 +130,7 @@ internal sealed partial class CharaDataHubUi
ImGui.AlignTextToFramePadding();
var note = _serverConfigurationManager.GetNoteForUid(user.UserData.UID);
var userText = note == null ? user.UserData.AliasOrUID : $"{note} ({user.UserData.AliasOrUID})";
UiSharedService.ColorText(userText, ImGuiColors.ParsedGreen);
UiSharedService.ColorText(userText, UIColors.Get("LightlessBlue"));
var buttonsize = _uiSharedService.GetIconButtonSize(FontAwesomeIcon.ArrowRight).X;
var buttonsize2 = _uiSharedService.GetIconButtonSize(FontAwesomeIcon.Plus).X;
@@ -165,7 +165,7 @@ internal sealed partial class CharaDataHubUi
UiSharedService.AttachToolTip(user.WorldDataDescriptor + UiSharedService.TooltipSeparator);
ImGui.SameLine();
_uiSharedService.IconText(FontAwesomeIcon.Map, sameMapAndServer.SameMap ? ImGuiColors.ParsedGreen : ImGuiColors.DalamudRed);
_uiSharedService.IconText(FontAwesomeIcon.Map, sameMapAndServer.SameMap ? UIColors.Get("LightlessBlue") : ImGuiColors.DalamudRed);
if (ImGui.IsItemClicked(ImGuiMouseButton.Left) && user.WorldData != null)
{
_dalamudUtilService.SetMarkerAndOpenMap(new(user.WorldData.Value.PositionX, user.WorldData.Value.PositionY, user.WorldData.Value.PositionZ), user.Map);
@@ -175,12 +175,12 @@ internal sealed partial class CharaDataHubUi
+ "Note: For GPose synchronization to work properly, you must be on the same map.");
ImGui.SameLine();
_uiSharedService.IconText(FontAwesomeIcon.Globe, sameMapAndServer.SameServer ? ImGuiColors.ParsedGreen : ImGuiColors.DalamudRed);
_uiSharedService.IconText(FontAwesomeIcon.Globe, sameMapAndServer.SameServer ? UIColors.Get("LightlessBlue") : ImGuiColors.DalamudRed);
UiSharedService.AttachToolTip((sameMapAndServer.SameMap ? "You are on the same server." : "You are not on the same server.") + UiSharedService.TooltipSeparator
+ "Note: GPose synchronization is not dependent on the current server, but you will have to spawn a character for the other lobby users.");
ImGui.SameLine();
_uiSharedService.IconText(FontAwesomeIcon.Running, sameMapAndServer.SameEverything ? ImGuiColors.ParsedGreen : ImGuiColors.DalamudRed);
_uiSharedService.IconText(FontAwesomeIcon.Running, sameMapAndServer.SameEverything ? UIColors.Get("LightlessBlue") : ImGuiColors.DalamudRed);
UiSharedService.AttachToolTip(sameMapAndServer.SameEverything ? "You are in the same instanced area." : "You are not the same instanced area." + UiSharedService.TooltipSeparator +
"Note: Users not in your instance, but on the same map, will be drawn as floating wisps." + Environment.NewLine
+ "Note: GPose synchronization is not dependent on the current instance, but you will have to spawn a character for the other lobby users.");

View File

@@ -241,7 +241,7 @@ internal sealed partial class CharaDataHubUi
ImGui.SameLine(pos);
if (!dataDto.HasMissingFiles)
{
UiSharedService.ColorTextWrapped("All files to download this character data are present on the server", ImGuiColors.HealerGreen);
UiSharedService.ColorTextWrapped("All files to download this character data are present on the server", UIColors.Get("LightlessBlue"));
}
else
{
@@ -769,7 +769,7 @@ internal sealed partial class CharaDataHubUi
}
else if (_charaDataManager.DataCreationTask != null && _charaDataManager.DataCreationTask.IsCompleted)
{
var color = _charaDataManager.DataCreationTask.Result.Success ? ImGuiColors.HealerGreen : ImGuiColors.DalamudRed;
var color = _charaDataManager.DataCreationTask.Result.Success ? UIColors.Get("LightlessBlue") : ImGuiColors.DalamudRed;
UiSharedService.ColorTextWrapped(_charaDataManager.DataCreationTask.Result.Output, color);
}

View File

@@ -112,7 +112,7 @@ internal partial class CharaDataHubUi
var noteText = pose.Key.MetaInfo.IsOwnData ? "YOU" : (userNote == null ? pose.Key.MetaInfo.Uploader.AliasOrUID : $"{userNote} ({pose.Key.MetaInfo.Uploader.AliasOrUID})");
ImGui.TextUnformatted("Pose by");
ImGui.SameLine();
UiSharedService.ColorText(noteText, ImGuiColors.ParsedGreen);
UiSharedService.ColorText(noteText, UIColors.Get("LightlessBlue"));
using (ImRaii.Group())
{
UiSharedService.ColorText("Character Data Description", ImGuiColors.DalamudGrey);
@@ -176,7 +176,7 @@ internal partial class CharaDataHubUi
Vector2 coneBase2 = circleCenter + baseDir2 * circleRadius;
// Draw the cone as a filled triangle
drawList.AddTriangleFilled(circleCenter, coneBase1, coneBase2, UiSharedService.Color(ImGuiColors.ParsedGreen));
drawList.AddTriangleFilled(circleCenter, coneBase1, coneBase2, UiSharedService.Color(UIColors.Get("LightlessBlue")));
drawList.AddCircle(circleCenter, circleDiameter / 2, UiSharedService.Color(ImGuiColors.DalamudWhite), 360, 2);
var distance = pose.Value.Distance.ToString("0.0") + "y";
var textSize = ImGui.CalcTextSize(distance);

View File

@@ -383,7 +383,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
UiSharedService.AttachToolTip($"Target the GPose Character {CharaName(actor.Name.TextValue)}");
ImGui.AlignTextToFramePadding();
var pos = ImGui.GetCursorPosX();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, actor.Address == (_dalamudUtilService.GetGposeTargetGameObjectAsync().GetAwaiter().GetResult()?.Address ?? nint.Zero)))
using (ImRaii.PushColor(ImGuiCol.Text, UIColors.Get("LightlessBlue"), actor.Address == (_dalamudUtilService.GetGposeTargetGameObjectAsync().GetAwaiter().GetResult()?.Address ?? nint.Zero)))
{
ImGui.TextUnformatted(CharaName(actor.Name.TextValue));
}

View File

@@ -276,7 +276,7 @@ public class CompactUi : WindowMediatorSubscriberBase
{
ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMin().X + UiSharedService.GetWindowContentRegionWidth()) / 2 - (userSize.X + textSize.X) / 2 - ImGui.GetStyle().ItemSpacing.X / 2);
if (!printShard) ImGui.AlignTextToFramePadding();
ImGui.TextColored(ImGuiColors.ParsedGreen, userCount);
ImGui.TextColored(UIColors.Get("LightlessPurple"), userCount);
ImGui.SameLine();
if (!printShard) ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted("Users Online");
@@ -589,7 +589,7 @@ public class CompactUi : WindowMediatorSubscriberBase
{
ServerState.Connecting => ImGuiColors.DalamudYellow,
ServerState.Reconnecting => ImGuiColors.DalamudRed,
ServerState.Connected => ImGuiColors.ParsedGreen,
ServerState.Connected => UIColors.Get("LightlessPurple"),
ServerState.Disconnected => ImGuiColors.DalamudYellow,
ServerState.Disconnecting => ImGuiColors.DalamudYellow,
ServerState.Unauthorized => ImGuiColors.DalamudRed,

View File

@@ -202,7 +202,7 @@ public class DrawUserPair
}
else if (!_pair.IsOnline)
{
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
using var _ = ImRaii.PushColor(ImGuiCol.Text, UIColors.Get("DimRed"));
_uiSharedService.IconText(_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.OneSided
? FontAwesomeIcon.ArrowsLeftRight
: (_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.Bidirectional
@@ -211,7 +211,7 @@ public class DrawUserPair
}
else if (_pair.IsVisible)
{
_uiSharedService.IconText(FontAwesomeIcon.Eye, ImGuiColors.ParsedGreen);
_uiSharedService.IconText(FontAwesomeIcon.Eye, UIColors.Get("LightlessBlue"));
userPairText = _pair.UserData.AliasOrUID + " is visible: " + _pair.PlayerName + Environment.NewLine + "Click to target this player";
if (ImGui.IsItemClicked())
{
@@ -220,7 +220,7 @@ public class DrawUserPair
}
else
{
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen);
using var _ = ImRaii.PushColor(ImGuiCol.Text, UIColors.Get("PairBlue"));
_uiSharedService.IconText(_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.Bidirectional
? FontAwesomeIcon.User : FontAwesomeIcon.Users);
userPairText = _pair.UserData.AliasOrUID + " is online";

View File

@@ -308,7 +308,7 @@ public partial class IntroUi : WindowMediatorSubscriberBase
}
else
{
UiSharedService.ColorTextWrapped($"OAuth2 is connected. Linked to: Discord User {_serverConfigurationManager.GetDiscordUserFromToken(selectedServer)}", ImGuiColors.HealerGreen);
UiSharedService.ColorTextWrapped($"OAuth2 is connected. Linked to: Discord User {_serverConfigurationManager.GetDiscordUserFromToken(selectedServer)}", UIColors.Get("LightlessBlue"));
UiSharedService.TextWrapped("Now press the update UIDs button to get a list of all of your UIDs on the server.");
_uiShared.DrawUpdateOAuthUIDsButton(selectedServer);
var playerName = _dalamudUtilService.GetPlayerName();

View File

@@ -110,7 +110,7 @@ public class PopoutProfileUi : WindowMediatorSubscriberBase
var rectMax = drawList.GetClipRectMax();
using (_uiSharedService.UidFont.Push())
UiSharedService.ColorText(_pair.UserData.AliasOrUID, ImGuiColors.HealerGreen);
UiSharedService.ColorText(_pair.UserData.AliasOrUID, UIColors.Get("LightlessBlue"));
ImGuiHelpers.ScaledDummy(spacing.Y, spacing.Y);
var textPos = ImGui.GetCursorPosY();
@@ -123,7 +123,7 @@ public class PopoutProfileUi : WindowMediatorSubscriberBase
UiSharedService.ColorText(note, ImGuiColors.DalamudGrey);
}
string status = _pair.IsVisible ? "Visible" : (_pair.IsOnline ? "Online" : "Offline");
UiSharedService.ColorText(status, (_pair.IsVisible || _pair.IsOnline) ? ImGuiColors.HealerGreen : ImGuiColors.DalamudRed);
UiSharedService.ColorText(status, (_pair.IsVisible || _pair.IsOnline) ? UIColors.Get("LightlessBlue") : ImGuiColors.DalamudRed);
if (_pair.IsVisible)
{
ImGui.SameLine();

View File

@@ -853,7 +853,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
_uiShared.DrawHelpText("If this option is selected all already existing notes for UIDs will be overwritten by the imported notes.");
if (_notesSuccessfullyApplied.HasValue && _notesSuccessfullyApplied.Value)
{
UiSharedService.ColorTextWrapped("User Notes successfully imported", ImGuiColors.HealerGreen);
UiSharedService.ColorTextWrapped("User Notes successfully imported", UIColors.Get("LightlessBlue"));
}
else if (_notesSuccessfullyApplied.HasValue && !_notesSuccessfullyApplied.Value)
{
@@ -1474,10 +1474,10 @@ public class SettingsUi : WindowMediatorSubscriberBase
ImGuiHelpers.ScaledDummy(5);
UiSharedService.ColorText("A potential rename/world change from this character was detected:", ImGuiColors.DalamudYellow);
using (ImRaii.PushIndent(10f))
UiSharedService.ColorText("Entry: " + authWithCid.CharacterName + " - " + _dalamudUtilService.WorldData.Value[(ushort)authWithCid.WorldId], ImGuiColors.ParsedGreen);
UiSharedService.ColorText("Entry: " + authWithCid.CharacterName + " - " + _dalamudUtilService.WorldData.Value[(ushort)authWithCid.WorldId], UIColors.Get("LightlessBlue"));
UiSharedService.ColorText("Press the button below to adjust that entry to your current character:", ImGuiColors.DalamudYellow);
using (ImRaii.PushIndent(10f))
UiSharedService.ColorText("Current: " + youName + " - " + _dalamudUtilService.WorldData.Value[(ushort)youWorld], ImGuiColors.ParsedGreen);
UiSharedService.ColorText("Current: " + youName + " - " + _dalamudUtilService.WorldData.Value[(ushort)youWorld], UIColors.Get("LightlessBlue"));
ImGuiHelpers.ScaledDummy(5);
if (_uiShared.IconTextButton(FontAwesomeIcon.ArrowRight, "Update Entry to Current Character"))
{
@@ -1528,7 +1528,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
{
misManaged = true;
}
Vector4 color = ImGuiColors.ParsedGreen;
Vector4 color = UIColors.Get("LightlessBlue");
string text = thisIsYou ? "Your Current Character" : string.Empty;
if (misManaged)
{
@@ -1926,11 +1926,11 @@ public class SettingsUi : WindowMediatorSubscriberBase
{
ImGui.TextUnformatted("Service " + _serverConfigurationManager.CurrentServer!.ServerName + ":");
ImGui.SameLine();
ImGui.TextColored(ImGuiColors.ParsedGreen, "Available");
ImGui.TextColored(UIColors.Get("LightlessBlue"), "Available");
ImGui.SameLine();
ImGui.TextUnformatted("(");
ImGui.SameLine();
ImGui.TextColored(ImGuiColors.ParsedGreen, _apiController.OnlineUsers.ToString(CultureInfo.InvariantCulture));
ImGui.TextColored(UIColors.Get("LightlessBlue"), _apiController.OnlineUsers.ToString(CultureInfo.InvariantCulture));
ImGui.SameLine();
ImGui.TextUnformatted("Users Online");
ImGui.SameLine();

View File

@@ -77,7 +77,7 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
var headerSize = ImGui.GetCursorPosY() - ImGui.GetStyle().WindowPadding.Y;
using (_uiSharedService.UidFont.Push())
UiSharedService.ColorText(Pair.UserData.AliasOrUID, ImGuiColors.HealerGreen);
UiSharedService.ColorText(Pair.UserData.AliasOrUID, UIColors.Get("LightlessBlue"));
ImGuiHelpers.ScaledDummy(new Vector2(spacing.Y, spacing.Y));
var textPos = ImGui.GetCursorPosY() - headerSize;
@@ -118,7 +118,7 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
UiSharedService.ColorText(note, ImGuiColors.DalamudGrey);
}
string status = Pair.IsVisible ? "Visible" : (Pair.IsOnline ? "Online" : "Offline");
UiSharedService.ColorText(status, (Pair.IsVisible || Pair.IsOnline) ? ImGuiColors.HealerGreen : ImGuiColors.DalamudRed);
UiSharedService.ColorText(status, (Pair.IsVisible || Pair.IsOnline) ? UIColors.Get("LightlessBlue") : ImGuiColors.DalamudRed);
if (Pair.IsVisible)
{
ImGui.SameLine();

View File

@@ -0,0 +1,34 @@
using System.Globalization;
using System.Numerics;
namespace LightlessSync.UI
{
internal static class UIColors
{
private static readonly Dictionary<string, string> HexColors = new(StringComparer.OrdinalIgnoreCase)
{
{ "LightlessPurple", "#ad8af5" },
{ "LightlessBlue", "#64c7e8" },
{ "PairBlue", "#4e98b1" },
{ "DimRed", "#bd0000" },
};
public static Vector4 Get(string name)
{
if (!HexColors.TryGetValue(name, out var hex))
throw new ArgumentException($"Color '{name}' not found in UIColors.");
return HexToRgba(hex);
}
public static Vector4 HexToRgba(string hexColor)
{
hexColor = hexColor.TrimStart('#');
int r = int.Parse(hexColor.Substring(0, 2), NumberStyles.HexNumber);
int g = int.Parse(hexColor.Substring(2, 2), NumberStyles.HexNumber);
int b = int.Parse(hexColor.Substring(4, 2), NumberStyles.HexNumber);
int a = hexColor.Length == 8 ? int.Parse(hexColor.Substring(6, 2), NumberStyles.HexNumber) : 255;
return new Vector4(r / 255f, g / 255f, b / 255f, a / 255f);
}
}
}

View File

@@ -305,7 +305,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
}
}
public static Vector4 GetBoolColor(bool input) => input ? ImGuiColors.ParsedGreen : ImGuiColors.DalamudRed;
public static Vector4 GetBoolColor(bool input) => input ? UIColors.Get("LightlessBlue") : UIColors.Get("DimRed");
public static string GetNotes(List<Pair> pairs)
{
@@ -394,7 +394,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
}
public static Vector4 UploadColor((long, long) data) => data.Item1 == 0 ? ImGuiColors.DalamudGrey :
data.Item1 == data.Item2 ? ImGuiColors.ParsedGreen : ImGuiColors.DalamudYellow;
data.Item1 == data.Item2 ? UIColors.Get("LightlessBlue") : ImGuiColors.DalamudYellow;
public bool ApplyNotesFromClipboard(string notes, bool overwrite)
{
@@ -436,7 +436,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
public void BooleanToColoredIcon(bool value, bool inline = true)
{
using var colorgreen = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, value);
using var colorgreen = ImRaii.PushColor(ImGuiCol.Text, UIColors.Get("LightlessBlue"), value);
using var colorred = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, !value);
if (inline) ImGui.SameLine();
@@ -645,7 +645,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
{
if (_discordOAuthCheck.Result != null)
{
ColorTextWrapped("Server is compatible with Discord OAuth2", ImGuiColors.HealerGreen);
ColorTextWrapped("Server is compatible with Discord OAuth2", UIColors.Get("LightlessBlue"));
}
else
{
@@ -678,7 +678,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
selectedServer.OAuthToken = _discordOAuthGetCode.Result;
_discordOAuthGetCode = null;
_serverConfigurationManager.Save();
ColorTextWrapped("Success", ImGuiColors.HealerGreen);
ColorTextWrapped("Success", UIColors.Get("LightlessBlue"));
}
else
{
@@ -708,7 +708,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
if (tokenExpiry > DateTime.UtcNow)
{
ColorTextWrapped($"OAuth2 is enabled, linked to: Discord User {_serverConfigurationManager.GetDiscordUserFromToken(selectedServer)}", ImGuiColors.HealerGreen);
ColorTextWrapped($"OAuth2 is enabled, linked to: Discord User {_serverConfigurationManager.GetDiscordUserFromToken(selectedServer)}", UIColors.Get("LightlessBlue"));
TextWrapped($"The OAuth2 token will expire on {tokenExpiry:yyyy-MM-dd} and automatically renew itself during login on or after {(tokenExpiry - TimeSpan.FromDays(7)):yyyy-MM-dd}.");
using (ImRaii.Disabled(!CtrlPressed()))
{
@@ -740,7 +740,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
if (foundUids > 0)
{
ColorTextWrapped($"Found {foundUids} associated UIDs on the server, Primary UID: {primaryUid.Key} (Vanity UID: {vanity})",
ImGuiColors.HealerGreen);
UIColors.Get("LightlessBlue"));
}
else
{