|
@@ -40,7 +40,7 @@ class TSLightGradientVC: TSBaseVC{
|
|
|
let colorPaletteView = TSLightColorPaletteView()
|
|
|
colorPaletteView.changedBrightnessComplete = { [weak self] floatNum in
|
|
|
guard let self = self else { return }
|
|
|
- UIDevice.brightness(brightness: floatNum)
|
|
|
+ brightnessNum = floatNum
|
|
|
}
|
|
|
|
|
|
colorPaletteView.changedSaturationComplete = { [weak self] floatNum in
|
|
@@ -66,7 +66,7 @@ class TSLightGradientVC: TSBaseVC{
|
|
|
|
|
|
let fullScreenBtn = UIButton.createButton(image: UIImage(named: "fullScreen"),backgroundColor: UIColor.fromHex("000000", alpha: 0.2),corner: 8.0) { [weak self] in
|
|
|
guard let self = self else { return }
|
|
|
- kPresentModalVC(target: self, modelVC: TSFullScreenVC.creatGradientVC(colorString: currentColorString),transitionStyle: .crossDissolve)
|
|
|
+ kPresentModalVC(target: self, modelVC: TSFullScreenVC.creatGradientVC(cgcolors:getCurrentColorGradient()),transitionStyle: .crossDissolve)
|
|
|
}
|
|
|
view.addSubview(fullScreenBtn)
|
|
|
fullScreenBtn.snp.makeConstraints { make in
|
|
@@ -115,14 +115,18 @@ class TSLightGradientVC: TSBaseVC{
|
|
|
|
|
|
|
|
|
func updateColorView(){
|
|
|
+ topView.addGradientBg(colors: getCurrentColorGradient())
|
|
|
+ }
|
|
|
+
|
|
|
+ func getCurrentColorGradient() -> [CGColor] {
|
|
|
let array = currentColorString.components(separatedBy: "-")
|
|
|
var colors = [CGColor]()
|
|
|
for string in array {
|
|
|
var color = string.color
|
|
|
- color = color.adjusted(saturation: saturationNum)
|
|
|
+ color = color.adjusted(brightness: brightnessNum,saturation: saturationNum)
|
|
|
colors.append(color.cgColor)
|
|
|
}
|
|
|
- topView.addGradientBg(colors: colors)
|
|
|
+ return colors
|
|
|
}
|
|
|
}
|
|
|
|