From 553dcb785c226f0a00e5af343843eaedb9f9589c Mon Sep 17 00:00:00 2001 From: Ben Weeks Date: Wed, 4 Jan 2023 17:01:23 +0000 Subject: [PATCH] Updated the new post button with gradient fill. Changelog-Changed: Added damus gradient to post button Closes: #244 --- .../Colors/DamusBlue.colorset/Contents.json | 38 +++++++++++++++++++ .../Colors/DamusPurple.colorset/Contents.json | 38 +++++++++++++++++++ damus/Views/PostButton.swift | 11 +++++- 3 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 damus/Assets.xcassets/Colors/DamusBlue.colorset/Contents.json create mode 100644 damus/Assets.xcassets/Colors/DamusPurple.colorset/Contents.json diff --git a/damus/Assets.xcassets/Colors/DamusBlue.colorset/Contents.json b/damus/Assets.xcassets/Colors/DamusBlue.colorset/Contents.json new file mode 100644 index 0000000..d34f822 --- /dev/null +++ b/damus/Assets.xcassets/Colors/DamusBlue.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0x4D", + "red" : "0x4B" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0x4D", + "red" : "0x4B" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/damus/Assets.xcassets/Colors/DamusPurple.colorset/Contents.json b/damus/Assets.xcassets/Colors/DamusPurple.colorset/Contents.json new file mode 100644 index 0000000..e5d5414 --- /dev/null +++ b/damus/Assets.xcassets/Colors/DamusPurple.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xC5", + "green" : "0x43", + "red" : "0xCC" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xC5", + "green" : "0x43", + "red" : "0xCC" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/damus/Views/PostButton.swift b/damus/Views/PostButton.swift index 7bce3f5..37cd99a 100644 --- a/damus/Views/PostButton.swift +++ b/damus/Views/PostButton.swift @@ -8,13 +8,20 @@ import Foundation import SwiftUI +let BUTTON_SIZE = 57.0 +let LINEAR_GRADIENT = LinearGradient(gradient: Gradient(colors: [ + Color("DamusPurple"), + Color("DamusBlue") +]), startPoint: .topTrailing, endPoint: .bottomTrailing) + + func PostButton(action: @escaping () -> ()) -> some View { return Button(action: action, label: { Image(systemName: "plus") .font(.system(.title2)) .foregroundColor(Color.white) - .frame(width: 57, height: 57, alignment: .center) - .background(Color.accentColor) + .frame(width: BUTTON_SIZE, height: BUTTON_SIZE, alignment: .center) + .background(LINEAR_GRADIENT) .cornerRadius(38.5) .padding() .shadow(color: Color.black.opacity(0.3),