Swiftpack.co - Charlisim/Palette-iOS as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Charlisim.
Charlisim/Palette-iOS v2.0.0
Like Android Palette for iOS. Written in Swift
⭐️ 24
🕓 2 weeks ago
.package(url: "https://github.com/Charlisim/Palette-iOS.git", from: "v2.0.0")

Palette-iOS Build Status

Like Android Palette for iOS. Written in Swift and compatible with Objective-C From any view (anything that inherits UIView) gets contrasting color (black or white) for specific point where is another view.


palette ios example palette ios example palette ios example

How to install


pod "Palette"

How to use

In Swift

let palette = Palette(background:self.view, forView:self.label)
self.label.textColor = palette.getContrastingColor()


self.label.textColor = Palette.getContrastingColor(self.view, forView: self.label)

In Objective-C

Palette * palette = [[Palette alloc] initWithBackground:self.view forView:label];
label.textColor =  [palette getContrastingColor];


label.textColor = [Palette getContrastingColor:self.view forView:label];


Stars: 24
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics