Skip to content

Commit

Permalink
ダークモード時のColorPickerが眩しいので修正
Browse files Browse the repository at this point in the history
  • Loading branch information
YuigaWada committed May 1, 2020
1 parent 16ba7b3 commit afa3e75
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions MissCat/View/Settings/ColorPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,18 @@ class ColorPicker: UIView, ChromaColorPickerDelegate {
}

private func setupBlur() {
let effect = UIBlurEffect(style: .extraLight)
let blurView = UIVisualEffectView(effect: effect)

let blurView = getBlurView()
blurView.frame = frame
addSubview(blurView)
}

private func getBlurView() -> UIVisualEffectView {
let colorMode = Theme.shared.currentModel?.colorMode ?? .light
let style: UIBlurEffect.Style = colorMode == .light ? .light : .dark

return UIVisualEffectView(effect: UIBlurEffect(style: style))
}

private func setupColorPicker(with initialColor: UIColor) {
colorPicker.delegate = self
addSubview(colorPicker)
Expand Down

0 comments on commit afa3e75

Please sign in to comment.