DragonFly is a framework that makes it easy to manipulate colors and fonts in your project. Some functions are:
Colors
color()
: Converts colors in hexadecimal or RGB formats to UIColorrandomColor()
: Creates a random UIColordarker()
: Makes the desired color darkerdarkerHigh()
: Makes the desired color even darkerlight()
: Makes the desired color lighterlightHigh()
: Makes the desired color even lighter
Fonts
large()
: Returns the font object for standard interface items with size 34.title1()
: Returns the font object for standard interface items with size 28.title2()
: Returns the font object for standard interface items with size 22.title3()
: Returns the font object for standard interface items with size 20.headline()
: Returns the font object for standard interface items with size 17.body()
: Returns the font object for standard interface items with size 17.callout()
: Returns the font object for standard interface items with size 16.subhead()
: Returns the font object for standard interface items with size 15.footnote()
: Returns the font object for standard interface items with size 13.caption1()
: Returns the font object for standard interface items with size 12.caption2()
: Returns the font object for standard interface items with size 11.
- iOS 2.0+
- Xcode 10+
- Swift 4.0+
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit the website below:
To integrate DragonFly into your Xcode project using CocoaPods, specify it in your Podfile:
pod 'DragonFly', :git => 'https://github.com/beacarlos/DragonFly'
let hexColor = Color(hex: "#FF5B5B")
let rgbColor = Color(red: 255, green: 91, blue: 91)!
hexColor.color()
rgbColor.color()
Color.randomColor()
hexColor.lighter(.lighter)
rgbColor.lighter(.lighterHigh)
The value of intensity
property can be .lighter or .lighterHigh
hexColor.darker(.darker)
rgbColor.darker(.darkerHigh)
The value of intensity
property can be .darker or .darkerHigh
// Create a gradient layer
let gradientLayer = Color.gradient(UIColor.orange, secondColor: UIColor.yellow)
// Set gradient frame
gradientLayer?.frame = button.bounds
// Add gradient to button
button.layer.insertSublayer(gradientLayer!, at: 0)
let font = UIFont(name: "DancingScript-Regular", size: 2)
lazy var fontCustom = Font(font: font)
let fontSystem = Font(font: .systemFont(ofSize: 0))
fontCustom.large()
fontSystem.title1()
fontSystem.title2()
fontSystem.title3()
fontSystem.headline()
fontSystem.body()
fontSystem.callout()
fontSystem.subhead()
fontSystem.footnote()
fontSystem.caption1()
fontSystem.caption2()
See the applications in the demo project: DragonFlyDemo