diff --git a/Sources/Keyboard/MIDIMonitorKeyboard.swift b/Sources/Keyboard/MIDIMonitorKeyboard.swift index 7c1817f..ec9aaa1 100644 --- a/Sources/Keyboard/MIDIMonitorKeyboard.swift +++ b/Sources/Keyboard/MIDIMonitorKeyboard.swift @@ -2,12 +2,14 @@ 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)) } } +@available(iOS 15, macOS 12, *) struct MIDIMonitorKeyboard: View { var layout: KeyboardLayout @@ -87,9 +89,13 @@ 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) } +*/