From 2b02d62bb9c8bb917e0a3989b642890e8c2ef136 Mon Sep 17 00:00:00 2001 From: Allan Evans Date: Fri, 16 Aug 2024 09:01:05 -0400 Subject: [PATCH 1/3] replaced hard coded rgb values in ActionBanner with semantic Color assets --- .../Contents.json | 20 +++++++++++++++++++ .../Contents.json | 20 +++++++++++++++++++ Nos/Views/ActionBanner.swift | 4 ++-- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 Nos/Assets/Colors.xcassets/action-banner-background-gradient-bottom.colorset/Contents.json create mode 100644 Nos/Assets/Colors.xcassets/action-banner-background-gradient-top.colorset/Contents.json diff --git a/Nos/Assets/Colors.xcassets/action-banner-background-gradient-bottom.colorset/Contents.json b/Nos/Assets/Colors.xcassets/action-banner-background-gradient-bottom.colorset/Contents.json new file mode 100644 index 000000000..fafa47672 --- /dev/null +++ b/Nos/Assets/Colors.xcassets/action-banner-background-gradient-bottom.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Nos/Assets/Colors.xcassets/action-banner-background-gradient-top.colorset/Contents.json b/Nos/Assets/Colors.xcassets/action-banner-background-gradient-top.colorset/Contents.json new file mode 100644 index 000000000..7121dd829 --- /dev/null +++ b/Nos/Assets/Colors.xcassets/action-banner-background-gradient-top.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "0.200", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Nos/Views/ActionBanner.swift b/Nos/Views/ActionBanner.swift index d59e58486..da0c04290 100644 --- a/Nos/Views/ActionBanner.swift +++ b/Nos/Views/ActionBanner.swift @@ -74,8 +74,8 @@ struct ActionBanner: View { ZStack { LinearGradient( colors: [ - Color(red: 1, green: 1, blue: 1, opacity: 0.2), - Color(red: 1, green: 1, blue: 1, opacity: 1.0), + Color.actionBannerBackgroundGradientTop, + Color.actionBannerBackgroundGradientBottom, ], startPoint: .top, endPoint: .bottom From 6650acbb61d02d572b2ccea82b3cc6d5f04b8b66 Mon Sep 17 00:00:00 2001 From: Allan Evans Date: Fri, 16 Aug 2024 09:31:00 -0400 Subject: [PATCH 2/3] replaced hard coded rgb values in BigActionButton with semantic Color assets also modified CHNAGELOG to reflect branch changes --- CHANGELOG.md | 2 +- .../Contents.json | 6 +++--- .../Contents.json | 20 +++++++++++++++++++ .../Contents.json | 20 +++++++++++++++++++ Nos/Views/BigActionButton.swift | 4 ++-- 5 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 Nos/Assets/Colors.xcassets/big-action-button-linear-gradient-stop1.colorset/Contents.json create mode 100644 Nos/Assets/Colors.xcassets/big-action-button-linear-gradient-stop2.colorset/Contents.json diff --git a/CHANGELOG.md b/CHANGELOG.md index df88a7545..d5d509569 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed the like and repost counts from the Main and Profile feeds. - Fixed an issue where the sheet asking users to set up a NIP-05 username would appear after reinstalling Nos, even if the profile already had a NIP-05 username. - Fixed a bug where urls with periods after them would include the period. -- Replaced hard-coded hex and white: opacity: color values. +- Replaced hard-coded hex, white: opacity:, and rgb color values. ## [0.1.24] - 2024-08-09Z diff --git a/Nos/Assets/Colors.xcassets/big-action-button-gradient-bottom.colorset/Contents.json b/Nos/Assets/Colors.xcassets/big-action-button-gradient-bottom.colorset/Contents.json index 41ece5bed..6b013c6eb 100644 --- a/Nos/Assets/Colors.xcassets/big-action-button-gradient-bottom.colorset/Contents.json +++ b/Nos/Assets/Colors.xcassets/big-action-button-gradient-bottom.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x55", - "green" : "0x43", - "red" : "0xF2" + "blue" : "0.333", + "green" : "0.263", + "red" : "0.949" } }, "idiom" : "universal" diff --git a/Nos/Assets/Colors.xcassets/big-action-button-linear-gradient-stop1.colorset/Contents.json b/Nos/Assets/Colors.xcassets/big-action-button-linear-gradient-stop1.colorset/Contents.json new file mode 100644 index 000000000..4f743d293 --- /dev/null +++ b/Nos/Assets/Colors.xcassets/big-action-button-linear-gradient-stop1.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x38", + "green" : "0x63", + "red" : "0xEF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Nos/Assets/Colors.xcassets/big-action-button-linear-gradient-stop2.colorset/Contents.json b/Nos/Assets/Colors.xcassets/big-action-button-linear-gradient-stop2.colorset/Contents.json new file mode 100644 index 000000000..eeb1d7442 --- /dev/null +++ b/Nos/Assets/Colors.xcassets/big-action-button-linear-gradient-stop2.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x54", + "green" : "0x4C", + "red" : "0xF2" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Nos/Views/BigActionButton.swift b/Nos/Views/BigActionButton.swift index c9808a704..4bee72332 100644 --- a/Nos/Views/BigActionButton.swift +++ b/Nos/Views/BigActionButton.swift @@ -69,8 +69,8 @@ struct BigActionButtonStyle: ButtonStyle { ZStack { LinearGradient( stops: [ - Gradient.Stop(color: Color(red: 0.94, green: 0.39, blue: 0.22), location: 0.00), - Gradient.Stop(color: Color(red: 0.95, green: 0.3, blue: 0.33), location: 1.00), + Gradient.Stop(color: Color.bigActionButtonLinearGradientStop1, location: 0.00), + Gradient.Stop(color: Color.bigActionButtonLinearGradientStop2, location: 1.00), ], startPoint: UnitPoint(x: 0.5, y: 0), endPoint: UnitPoint(x: 0.5, y: 0.99) From 686fc9b918df02f21fa1bb9bd8afb55b4829892f Mon Sep 17 00:00:00 2001 From: Allan Evans Date: Fri, 16 Aug 2024 09:57:32 -0400 Subject: [PATCH 3/3] CHANGELOG edited per PR comments --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5d509569..219f3acf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed the like and repost counts from the Main and Profile feeds. - Fixed an issue where the sheet asking users to set up a NIP-05 username would appear after reinstalling Nos, even if the profile already had a NIP-05 username. - Fixed a bug where urls with periods after them would include the period. -- Replaced hard-coded hex, white: opacity:, and rgb color values. +- Replaced hard-coded color values. ## [0.1.24] - 2024-08-09Z