diff --git a/Sources/Keyboard/MIDIMonitorKeyboard.swift b/Sources/Keyboard/MIDIMonitorKeyboard.swift index c5665a3..b92257b 100644 --- a/Sources/Keyboard/MIDIMonitorKeyboard.swift +++ b/Sources/Keyboard/MIDIMonitorKeyboard.swift @@ -2,13 +2,15 @@ import SwiftUI import Tonic +@available(iOS 15, macOS 12, *) extension GraphicsContext { func fill(rect: CGRect, with color: Color) { fill(Path(roundedRect: rect, cornerRadius: 0), with: GraphicsContext.Shading.color(color)) } } -public struct MIDIMonitorKeyboard: View { +@available(iOS 15, macOS 12, *) +struct MIDIMonitorKeyboard: View { var layout: KeyboardLayout var activatedPitches: PitchSet @@ -87,9 +89,13 @@ public struct MIDIMonitorKeyboard: View { } var p = PitchSet(pitches: [Pitch(65), Pitch(68), Pitch(71), Pitch(74)]) + +// Removing Preview macro until Xcode 15 is released +/* #Preview { MIDIMonitorKeyboard(layout: .piano(pitchRange: Pitch(61)...Pitch(88)), activatedPitches: p, colorFunction: { x in Color(cgColor: PitchColor.helmholtz[Int(x.pitchClass)])} ).frame(width: 600, height: 100) } +*/