Created
July 8, 2021 20:23
-
-
Save rudrankriyam/adc23988e5d7465941a9cd79b860c6c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class RGBRandomColor: RGBColorProtocol { | |
| var red: Double = Constants.random | |
| var green: Double = Constants.random | |
| var blue: Double = Constants.random | |
| } | |
| class RGBUserColor: RGBColorProtocol { | |
| static let initial: Double = 188/255 | |
| var red: Double = RGBInitialColor.initial | |
| var green: Double = RGBInitialColor.initial | |
| var blue: Double = RGBInitialColor.initial | |
| } | |
| class RGBTestStartColor: RGBColorProtocol { | |
| var red: Double = 19/255 | |
| var green: Double = 84/255 | |
| var blue: Double = 122/255 | |
| } | |
| class RGBTestEndColor: RGBColorProtocol { | |
| var red: Double = 128/255 | |
| var green: Double = 208/255 | |
| var blue: Double = 199/255 | |
| } | |
| struct Constants { | |
| static var random: Double { | |
| Double.random(in: 0...1) | |
| } | |
| } | |
| class RGBRandomGradient: GradientProtocol { | |
| var startColor: ColorProtocol = RGBRandomColor() | |
| var endColor: ColorProtocol = RGBRandomColor() | |
| } | |
| class RGBUserGradient: GradientProtocol { | |
| var startColor: ColorProtocol = RGBUserColor() | |
| var endColor: ColorProtocol = RGBUserColor() | |
| } | |
| class RGBTestGradient: GradientProtocol { | |
| var startColor: ColorProtocol = RGBTestStartColor() | |
| var endColor: ColorProtocol = RGBTestEndColor() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment