mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
add web label color selections and choose a random color as the initial selection
This commit is contained in:
parent
a75c8e91a4
commit
f8ba24bc79
1 changed files with 18 additions and 1 deletions
|
|
@ -102,7 +102,12 @@ struct CreateLabelView: View {
|
|||
GridItem(.fixed(70))
|
||||
]
|
||||
|
||||
let swatches = swatchHexes.map { Color(hex: $0) ?? .clear }.shuffled()
|
||||
let swatches: [Color] = {
|
||||
let webSwatches = webSwatchHexes.map { Color(hex: $0) ?? .clear }
|
||||
var additionalSwatches = swatchHexes.map { Color(hex: $0) ?? .clear }.shuffled()
|
||||
let firstSwatch = additionalSwatches.remove(at: 0)
|
||||
return [firstSwatch] + webSwatches + additionalSwatches
|
||||
}()
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
|
|
@ -174,10 +179,22 @@ struct CreateLabelView: View {
|
|||
#if os(iOS)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
.onAppear {
|
||||
newLabelColor = swatches.first ?? .clear
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private let webSwatchHexes = [
|
||||
"#FF5D99",
|
||||
"#7CFF7B",
|
||||
"#FFD234",
|
||||
"#7BE4FF",
|
||||
"#CE88EF",
|
||||
"#EF8C43"
|
||||
]
|
||||
|
||||
private let swatchHexes = [
|
||||
"#fff034",
|
||||
"#efff34",
|
||||
|
|
|
|||
Loading…
Reference in a new issue