调色板 1.0.1

调色板 1.0.1

测试已测试
Lang语言 SwiftSwift
许可 MIT
发布上次发布2015 年 7 月
SPM支持 SPM

Carlos Simon 维护。




调色板 1.0.1

Palette-iOS

类似于为 iOS 编写的 Android Palette。使用 Swift 编写并兼容 Objective-C,从任何视图(任何继承自 UIView 的内容)获取与另一个视图特定点处对比的颜色(黑色或白色)。

截图

palette ios example palette ios example palette ios example

如何安装

如何使用

在 Swift 中

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

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

在 Objective-C 中

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

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