diff --git a/Demo/Shared/ContentView.swift b/Demo/Shared/ContentView.swift index 8be9388..31ace11 100644 --- a/Demo/Shared/ContentView.swift +++ b/Demo/Shared/ContentView.swift @@ -150,7 +150,7 @@ struct ContentView: View { Keyboard(latching: true, noteOn: noteOn, noteOff: noteOff) { pitch, isActivated in if isActivated { ZStack { - Rectangle().foregroundColor(.black) + Rectangle().foregroundStyle(.black) VStack { Spacer() Text(pitch.note(in: .C).description).font(.largeTitle) @@ -158,7 +158,7 @@ struct ContentView: View { } } else { - Rectangle().foregroundColor(randomColors[Int(pitch.intValue) % 12]) + Rectangle().foregroundStyle(randomColors[Int(pitch.intValue) % 12]) } } .frame(minWidth: 100, minHeight: 100) diff --git a/Sources/Keyboard/KeyboardKey.swift b/Sources/Keyboard/KeyboardKey.swift index c9bdeca..02ea0ba 100644 --- a/Sources/Keyboard/KeyboardKey.swift +++ b/Sources/Keyboard/KeyboardKey.swift @@ -109,16 +109,16 @@ public struct KeyboardKey: View { GeometryReader { proxy in ZStack(alignment: alignment) { Rectangle() - .foregroundColor(keyColor) + .foregroundStyle(keyColor) .padding(.top, topPadding(proxy.size)) .padding(.leading, leadingPadding(proxy.size)) - .cornerRadius(relativeCornerRadius(in: proxy.size)) + .clipShape(RoundedRectangle(cornerRadius: relativeCornerRadius(in: proxy.size))) .padding(.top, negativeTopPadding(proxy.size)) .padding(.leading, negativeLeadingPadding(proxy.size)) .padding(.trailing, 0.5) Text(text) - .font(Font(.init(.system, size: relativeFontSize(in: proxy.size)))) - .foregroundColor(textColor) + .font(.system(size: relativeFontSize(in: proxy.size))) + .foregroundStyle(textColor) .padding(relativeFontSize(in: proxy.size) / 3.0) } }