I don't think it's possible to do that without opening it modally. That is the UIColorPickerViewController in UIKit, or ColorPicker in SwiftUI. It looks like this in iOS 14.
and in iPadOS 14 it would look like this
In SwiftUI it can be created like this:
struct ContentView: View {
@State var color = Color(.blue)
var body: some View {
ColorPicker("Color", selection: $color)
.padding(.horizontal, 150)
}
}
and in UIKit it is like this
// Initializing Color Picker
let picker = UIColorPickerViewController()
// Setting the Initial Color of the Picker
picker.selectedColor = self.view.backgroundColor!
// Setting Delegate
picker.delegate = self
// Presenting the Color Picker
self.present(picker, animated: true, completion: nil)
For more information you can take a look at these websites:
Now Additionally, if you really want it to be in a little window, you can use a PopOver and create your own color picker, it is a bit of work but shouldn't be too hard.
Here are some resources that might help you:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…