mirror of
https://github.com/fxm90/GradientLoadingBar.git
synced 2026-06-16 12:24:31 +00:00
♻️ :: Move custom colors to config value
This commit is contained in:
@@ -16,6 +16,12 @@ final class AdvancedExampleViewController: UIViewController {
|
||||
private enum Config {
|
||||
/// The programatically applied height of the `GradientActivityIndicatorView`.
|
||||
static let height: CGFloat = 3.5
|
||||
|
||||
/// The custom gradient colors we use.
|
||||
/// Source: https://color.adobe.com/Pink-Flamingo-color-theme-10343714/
|
||||
static let gradientColors = [
|
||||
#colorLiteral(red: 0.9490196078, green: 0.3215686275, blue: 0.431372549, alpha: 1), #colorLiteral(red: 0.9450980392, green: 0.4784313725, blue: 0.5921568627, alpha: 1), #colorLiteral(red: 0.9529411765, green: 0.737254902, blue: 0.7843137255, alpha: 1), #colorLiteral(red: 0.4274509804, green: 0.8666666667, blue: 0.9490196078, alpha: 1), #colorLiteral(red: 0.7568627451, green: 0.9411764706, blue: 0.9568627451, alpha: 1),
|
||||
]
|
||||
}
|
||||
|
||||
// MARK: - Outlets
|
||||
@@ -64,10 +70,7 @@ final class AdvancedExampleViewController: UIViewController {
|
||||
}
|
||||
|
||||
private func setupCustomColorsGradientLoadingBar() {
|
||||
// Source: https://color.adobe.com/Pink-Flamingo-color-theme-10343714/
|
||||
customColorsGradientLoadingBar.gradientColors = [
|
||||
#colorLiteral(red: 0.9490196078, green: 0.3215686275, blue: 0.431372549, alpha: 1), #colorLiteral(red: 0.9450980392, green: 0.4784313725, blue: 0.5921568627, alpha: 1), #colorLiteral(red: 0.9529411765, green: 0.737254902, blue: 0.7843137255, alpha: 1), #colorLiteral(red: 0.4274509804, green: 0.8666666667, blue: 0.9490196078, alpha: 1), #colorLiteral(red: 0.7568627451, green: 0.9411764706, blue: 0.9568627451, alpha: 1),
|
||||
]
|
||||
customColorsGradientLoadingBar.gradientColors = Config.gradientColors
|
||||
}
|
||||
|
||||
@IBAction private func toggleCustomSuperviewButtonTouchUpInside(_: Any) {
|
||||
|
||||
Reference in New Issue
Block a user