From 3002d250a1a42a38d61bb47f5664e8bfa025c149 Mon Sep 17 00:00:00 2001 From: Sebastian Stachowicz <50264212+Sebastian2852@users.noreply.github.com> Date: Fri, 1 Aug 2025 02:36:03 +0000 Subject: [PATCH] Fix Table diff colors (#1084) --- CHANGELOG.md | 5 +++- .../Components/PatchVisualizer/DomLabel.lua | 2 +- .../Components/StringDiffVisualizer/init.lua | 4 +-- .../Components/TableDiffVisualizer/Array.lua | 2 +- .../TableDiffVisualizer/Dictionary.lua | 10 +++----- plugin/src/App/Theme.lua | 25 ++++++++++++++++--- 6 files changed, 33 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab5843f2..abafc706 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,15 @@ # Rojo Changelog ## Unreleased + +* Fixed colors of Table diff ([#1084]) * Fixed `sourcemap` command outputting paths with OS-specific path separators ([#1085]) * Fixed nil -> nil properties showing up as failing to sync in plugin's patch visualizer ([#1081]) -* Changed the background of the server's in-browser UI to be gray instead of white ([#1080]) +* Changed the background of the server's in-browser UI to be gray instead of white ([#1080]) * Fixed `Auto Connect Playtest Server` no longer functioning due to Roblox change ([#1066]) * Added an update indicator to the version header when a new version of the plugin is available. ([#1069]) +[#1084]: https://github.com/rojo-rbx/rojo/pull/1084 [#1085]: https://github.com/rojo-rbx/rojo/pull/1085 [#1081]: https://github.com/rojo-rbx/rojo/pull/1081 [#1080]: https://github.com/rojo-rbx/rojo/pull/1080 diff --git a/plugin/src/App/Components/PatchVisualizer/DomLabel.lua b/plugin/src/App/Components/PatchVisualizer/DomLabel.lua index 689f8143..bc9b110e 100644 --- a/plugin/src/App/Components/PatchVisualizer/DomLabel.lua +++ b/plugin/src/App/Components/PatchVisualizer/DomLabel.lua @@ -95,7 +95,7 @@ function DomLabel:render() return Theme.with(function(theme) local color = if props.isWarning then theme.Diff.Warning - elseif props.patchType then theme.Diff[props.patchType] + elseif props.patchType then theme.Diff.Background[props.patchType] else theme.TextColor local indent = (depth - 1) * 12 + 15 diff --git a/plugin/src/App/Components/StringDiffVisualizer/init.lua b/plugin/src/App/Components/StringDiffVisualizer/init.lua index a826c649..e8e0d024 100644 --- a/plugin/src/App/Components/StringDiffVisualizer/init.lua +++ b/plugin/src/App/Components/StringDiffVisualizer/init.lua @@ -178,7 +178,7 @@ function StringDiffVisualizer:render() size = UDim2.new(1, 0, 1, 0), position = UDim2.new(0, 0, 0, 0), text = oldString, - lineBackground = theme.Diff.Remove, + lineBackground = theme.Diff.Background.Remove, markedLines = self.state.remove, }), }), @@ -193,7 +193,7 @@ function StringDiffVisualizer:render() size = UDim2.new(1, 0, 1, 0), position = UDim2.new(0, 0, 0, 0), text = newString, - lineBackground = theme.Diff.Add, + lineBackground = theme.Diff.Background.Add, markedLines = self.state.add, }), }), diff --git a/plugin/src/App/Components/TableDiffVisualizer/Array.lua b/plugin/src/App/Components/TableDiffVisualizer/Array.lua index 4e9a3daf..1ca002d4 100644 --- a/plugin/src/App/Components/TableDiffVisualizer/Array.lua +++ b/plugin/src/App/Components/TableDiffVisualizer/Array.lua @@ -93,7 +93,7 @@ function Array:render() e("Frame", { Size = UDim2.new(1, 0, 0, 25), BackgroundTransparency = if patchType == "Remain" then 1 else self.props.transparency, - BackgroundColor3 = if patchType == "Remain" then theme.Diff.Row else theme.Diff[patchType], + BackgroundColor3 = theme.Diff.Background[patchType], BorderSizePixel = 0, LayoutOrder = i, }, { diff --git a/plugin/src/App/Components/TableDiffVisualizer/Dictionary.lua b/plugin/src/App/Components/TableDiffVisualizer/Dictionary.lua index db3697bd..f5ac319c 100644 --- a/plugin/src/App/Components/TableDiffVisualizer/Dictionary.lua +++ b/plugin/src/App/Components/TableDiffVisualizer/Dictionary.lua @@ -91,9 +91,7 @@ function Dictionary:render() LayoutOrder = order, BorderSizePixel = 0, BackgroundTransparency = if line.patchType == "Remain" then 1 else self.props.transparency, - BackgroundColor3 = if line.patchType == "Remain" - then theme.Diff.Row - else theme.Diff[line.patchType], + BackgroundColor3 = theme.Diff.Background[line.patchType], }, { DiffIcon = if line.patchType ~= "Remain" then e("ImageLabel", { @@ -114,7 +112,7 @@ function Dictionary:render() TextXAlignment = Enum.TextXAlignment.Left, FontFace = theme.Font.Main, TextSize = theme.TextSize.Body, - TextColor3 = theme.Settings.Setting.DescriptionColor, + TextColor3 = theme.Diff.Text[line.patchType], TextTruncate = Enum.TextTruncate.AtEnd, }), OldValue = e("Frame", { @@ -125,7 +123,7 @@ function Dictionary:render() e(DisplayValue, { value = oldValue, transparency = self.props.transparency, - textColor = theme.Settings.Setting.DescriptionColor, + textColor = theme.Diff.Text[line.patchType], }), }), NewValue = e("Frame", { @@ -136,7 +134,7 @@ function Dictionary:render() e(DisplayValue, { value = newValue, transparency = self.props.transparency, - textColor = theme.Settings.Setting.DescriptionColor, + textColor = theme.Diff.Text[line.patchType], }), }), }) diff --git a/plugin/src/App/Theme.lua b/plugin/src/App/Theme.lua index 6e644aca..09e3bd57 100644 --- a/plugin/src/App/Theme.lua +++ b/plugin/src/App/Theme.lua @@ -165,12 +165,29 @@ function StudioProvider:updateTheme() BackgroundColor = studioTheme:GetColor(Enum.StudioStyleGuideColor.InputFieldBackground), }, Diff = { - -- Studio doesn't have good colors since their diffs use backgrounds, not text - Add = if isDark then Color3.fromRGB(143, 227, 154) else Color3.fromRGB(41, 164, 45), - Remove = if isDark then Color3.fromRGB(242, 125, 125) else Color3.fromRGB(150, 29, 29), - Edit = if isDark then Color3.fromRGB(120, 154, 248) else Color3.fromRGB(0, 70, 160), + -- Very bright different colors in case some places were not updated to use + -- the new background diff colors. + Add = Color3.fromRGB(255, 0, 255), + Remove = Color3.fromRGB(255, 0, 255), + Edit = Color3.fromRGB(255, 0, 255), + Row = studioTheme:GetColor(Enum.StudioStyleGuideColor.BrightText), Warning = studioTheme:GetColor(Enum.StudioStyleGuideColor.WarningText), + + Background = { + -- Studio doesn't have good colors since their diffs use backgrounds, not text + Add = if isDark then Color3.fromRGB(143, 227, 154) else Color3.fromRGB(41, 164, 45), + Remove = if isDark then Color3.fromRGB(242, 125, 125) else Color3.fromRGB(150, 29, 29), + Edit = if isDark then Color3.fromRGB(120, 154, 248) else Color3.fromRGB(0, 70, 160), + Remain = studioTheme:GetColor(Enum.StudioStyleGuideColor.BrightText), + }, + + Text = { + Add = if isDark then Color3.new(0, 0, 0) else Color3.new(1, 1, 1), + Remove = if isDark then Color3.new(0, 0, 0) else Color3.new(1, 1, 1), + Edit = if isDark then Color3.new(0, 0, 0) else Color3.new(1, 1, 1), + Remain = studioTheme:GetColor(Enum.StudioStyleGuideColor.MainText), + }, }, ConnectionDetails = { ProjectNameColor = studioTheme:GetColor(Enum.StudioStyleGuideColor.BrightText),