CostumeKit alternatives and similar libraries
Based on the "Color" category.
Alternatively, view CostumeKit alternatives based on common mentions on social networks and blogs.
-
Chameleon
DISCONTINUED. Color framework for Swift & Objective-C (Gradient colors, hexcode support, colors from images & more). -
Colours
A beautiful set of predefined colors and a set of color methods to make your iOS/OSX development life easier. -
Gestalt
An unintrusive & light-weight iOS app-theming library with support for animated theme switching. -
PrettyColors
Styles and colors text in the Terminal with ANSI escape codes. Conforms to ECMA Standard 48. -
SwiftColorGen
DISCONTINUED. A tool that generate code for Swift projects, designed to improve the maintainability of UIColors -
Colorify
DISCONTINUED. Simple, yet powerful color library that includes latest and most trendy colors from 2017.
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of CostumeKit or a related project?
README
CostumeKit :tophat:
Base types for theming an app.
CostumeKit is made of up a set of Swift protocols. They are meant to be implemented by you in your app.
Featured in Little Bites of Cocoa Bite #270: Implementing Theming with CostumeKit
Color :art:
Includes Color
and ColorPalette
protocols.
Usage:
public enum MyAppColors : Color, ColorPalette {
case white = "FFFFFF"
case lightTeal = "3CB39E"
case forestGreen = "216055"
case black = "000000"
}
Font :capital_abcd:
Includes Font
protocol, and one concrete SystemFont
implementation for iOS system fonts.
Usage:
public struct MyAppFont : Font {
public init(size: FontSize = .textStyle(.body)) {
self.size = size
}
// Font
public var size: FontSize
// FontConvertible
public var FontValue: UIFont {
return UIFont(name: "SomeCustomFont", size: pointSize)!
}
}
SVG :stars:
Includes SVG
Protocol and SVGMetadata
type.
Usage:
enum MyAppSVGs {
case clockGlyph
case bird
}
extension MyAppSVGs : SVG {
public func metadata() -> SVGMetadata {
switch self {
case .clockGlyph: return SVGMetadata(name: "clock", size: CGSize(width: 100, height: 100), fullColor: false)
case .bird: return SVGMetadata(name: "bird", size: CGSize(width: 58, height: 28), fullColor: true)
}
}
}
What you do with SVGMetadata
is up to you. I recommend SwiftSVG from Michael Choe. Read more here to learn how to use it.
CostumeKit's goals are to be a generic solution, so no assumptions are made about how something should be retrieved from disk, parsed, etc. You'll need to implement these anyways, so nothing is forced on you.
Costume :tophat:
Includes Costume
protocol. Usage:
open class MyAppCostume : Costume {
let spacing = CGFloat(8)
public func wearRootBackground(_ view: UIView) {
view.backgroundColor = Color.black.colorValue
}
public func wearHeadline(_ label: UILabel) {
label.font = MyAppFont(size: .textStyle(.title1)).fontValue
label.textColor = MyAppColors.forestGreen.colorValue
}
public var name: String { return "Default" }
public var description: String { return "The default costume." }
public init() { }
}
Cheers.