ui: move gradient components to their own group

This commit is contained in:
William Casarin
2023-05-09 18:13:33 -07:00
parent e3b3c9dedd
commit a13efb7832
4 changed files with 57 additions and 11 deletions

View File

@@ -0,0 +1,15 @@
//
// AlbyGradient.swift
// damus
//
// Created by William Casarin on 2023-05-09.
//
import SwiftUI
fileprivate let alby_grad_c1 = hex_col(r: 226, g: 168, b: 122)
fileprivate let alby_grad_c2 = hex_col(r: 249, g: 223, b: 127)
fileprivate let alby_grad = [alby_grad_c2, alby_grad_c1]
let AlbyGradient: LinearGradient =
LinearGradient(colors: alby_grad, startPoint: .bottomLeading, endPoint: .topTrailing)

View File

@@ -0,0 +1,26 @@
//
// DamusGradient.swift
// damus
//
// Created by William Casarin on 2023-05-09.
//
import SwiftUI
fileprivate let damus_grad_c1 = hex_col(r: 0x1c, g: 0x55, b: 0xff)
fileprivate let damus_grad_c2 = hex_col(r: 0x7f, g: 0x35, b: 0xab)
fileprivate let damus_grad_c3 = hex_col(r: 0xff, g: 0x0b, b: 0xd6)
fileprivate let damus_grad = [damus_grad_c1, damus_grad_c2, damus_grad_c3]
struct DamusGradient: View {
var body: some View {
LinearGradient(colors: damus_grad, startPoint: .bottomLeading, endPoint: .topTrailing)
.edgesIgnoringSafeArea([.top,.bottom])
}
}
struct DamusGradient_Previews: PreviewProvider {
static var previews: some View {
DamusGradient()
}
}