You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12-3
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,28 @@
2
2
3
3
All notable changes to this project will be documented in this file.
4
4
5
-
## 1.4.2 - 2019-5-06
5
+
## 1.4.3 - 2020-6-04
6
+
7
+
### Added
8
+
- property `reversePercentage` and `thumbLabelFormatter` added to `ColorSliderControl` and property `reverseBrightnessPercentage` added to `DefaultColorPickerViewController` to allow for more control over thumb label (slider percentage).
9
+
- new row added to demo demonstrating use of `reverseBrightnessPercentage` with `DefaultColorPickerViewController`
10
+
11
+
### Fixed
12
+
Issue #29: Is it me or is does brightness work backwards?
13
+
14
+
## 1.4.2 - 2020-5-06
6
15
7
16
### Fixed
8
17
Issue #27 that prevented compilation of 1.4.1 when installed via SPM.
9
18
10
-
## 1.4.1 - 2019-5-04
19
+
## 1.4.1 - 2020-5-04
11
20
12
21
WARNING: Do not use this realese. It does not compile when istaled via SPM. Use 1.4.2 instead.
Copy file name to clipboardExpand all lines: FlexColorPicker/Classes/Controls/ColorSliderControl.swift
+26-1
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,24 @@ open class ColorSliderControl: ColorControlWithThumbView {
42
42
publicletgradientBackgroundView=UIImageView()
43
43
/// Previews color options avaialable va chnaging value of the slider in form of linear gradient.
44
44
publicletgradientView=GradientView()
45
+
46
+
/// When `true` the thumb shows 100% label for left-most possition of the slider and 0% for right-most possition. Default is `false` (0% is displayed on left). Has no effect if `thumbLabelFormatter` is set.
47
+
///
48
+
/// This is usefull e.g. when "physically correct" percentage label behaviour of `BrightnessSliderControl` is preferred (as the most "bright" color is on the left of the slider in that case).
/// When set to non-nil value it will be used to generate label text of `thumbView` directly instead of via setting `thumbView`s `percentage` property. setting this overrides `percentage` property.
Copy file name to clipboardExpand all lines: FlexColorPicker/Classes/Controls/ComponentSliderControls.swift
+13
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,20 @@ final public class SaturationSliderControl: ColorSliderControl {
40
40
/// Color slider that allows to change brightness (in terms of HSB color model) of currently selected color by panning the slider line or by tapping it.
41
41
///
42
42
/// Tapping left end of the slider will select slider's current color modified to have 100% brightness. Tapping right edge of the slider will select current color modified to have 0% brightness.
43
+
///
44
+
/// - Note: Unlike other provided sliders, this slider's default thumb label percentage shown does not correspond to actual physical properties of the selected color.
45
+
/// When thumb is on lift-most side of the slider it shows 0% while the color brightness is actually 100% (and vice-versa for the right-most thumb position). This is intentional as most users expect such behaviour.
46
+
/// If "physically correct" percentage label behaviour is preferred (this is usually the case when you your UI labels this slider as "Brightness:" or when your user base might be more knowleadgable about colors theory) set property `reversePercentage` to true.
/// When `true` the thumb shows 100% label for left-most possition of the slider and 0% for right-most possition. Default is `false` (0% is displayed on left). Has no effect if `thumbLabelFormatter` is set.
50
+
///
51
+
/// This is usefull when "physically correct" percentage label behaviour is preferred (as the most "bright" color is on the left of the slider).
/// When `true` the brightness slider label shows 100% for the left-most possition of the slider thumb and 0% for right-most possition. Default is `false` (0% is displayed on left).
96
+
///
97
+
/// This is usefull when "physically correct" percentage label behaviour of `BrightnessSliderControl` is preffered (as the most "bright" color is on the left of the slider). However, default value corresponds to the behaviour most users expect.
98
+
@IBInspectable
99
+
publicvarreverseBrightnessPercentage:Bool{
100
+
get{
101
+
return brightnessSlider.reversePercentage
102
+
}
103
+
set{
104
+
brightnessSlider.reversePercentage = newValue
105
+
}
106
+
}
94
107
95
108
/// Color picker delegate that gets called when selected color is updated or confirmed. The delegate is not retained. This is just convinience property and getting or setting it is equivalent to getting or setting `colorPicker.delegate`.
/// The percentage displayed in `percentageLabel` unless overriden by dirrectly setting `percentageLabel.text` after setting this property.
75
+
///
76
+
/// Note: In `ColorSliderControl`s this typically corresponds to value of the slider but must not correspond to actual text displayed in `thumbLabel` if `ColorSliderControl.thumbLabelFormatter` is set.
0 commit comments