Skip to content

Charlisim/Palette-iOS

Repository files navigation

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.

Screenshots

palette ios example

palette ios example

palette ios example

How to install

Cocoapods

pod "Palette"

How to use

In Swift

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

or

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];

or

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

About

Like Android Palette for iOS. Written in Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published