Skip to content

Commit

Permalink
feat: Button to quickly flip gradient colors (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbmorley authored Jan 5, 2023
1 parent cd702c0 commit f6daedc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Symbolic/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@ struct ContentView: View {
ColorPicker("Top Color",
selection: $document.icon.topColor.undoable(undoManager, context: undoContext),
supportsOpacity: false)
Button {
let topColor = document.icon.topColor
let bottomColor = document.icon.bottomColor
undoManager?.registerUndo(undoContext) {
document.icon.topColor = topColor
document.icon.bottomColor = bottomColor
}
document.icon.topColor = bottomColor
document.icon.bottomColor = topColor
} label: {
Image(systemName: "arrow.up.arrow.down")
}
.horizontalSpace(.both)
ColorPicker("Bottom Color",
selection: $document.icon.bottomColor.undoable(undoManager, context: undoContext),
supportsOpacity: false)
Expand Down

0 comments on commit f6daedc

Please sign in to comment.