fnky / chroma Goto Github PK
View Code? Open in Web Editor NEWA Swift library for color generation and manipulation
License: MIT License
A Swift library for color generation and manipulation
License: MIT License
Add some Documentation
It should be possible to compare types in Chroma. Such as ColorTint
e.g.
var a: ColorTint = ColorTint(...)
var b: ColorTint = ColorTint(...)
Perhaps be able to merge as well
Add component a.startColor
to b.startColor
, and (if not nil
) a.endColor
to b.endColor
.
var c: ColorTint = a + b
Subtract component a.startColor
from b.startColor
, and (if not nil
) a.endColor
from b.endColor
.
var c: ColorTint = a - b
Compare hash values between component a
and b
. If they're equal return true
, otherwise false
.
var isEqual: Bool = a == b
var notEqual: Bool = a != b
Currently an init(startColor: UIColor!, endColor: UIColor?)
is defined, but not used for anything.
Implement an algorithm to generate colors between startColor
and endColor
, to tintForIndex(index: Int)
in ColorTint
struct.
Gotta add tests and coverage for pull requests and development.
The project should be supported on both iOS & Mac. To support types from Cocoa and UIKit without having to reimplement a functionality for both, we can use this code
#if os(iOS)
import UIKit
typealias ChromaColor = UIColor
#else
import Cocoa
typealias ChromaColor = NSColor
#endif
public extension ChromaColor {}
Checks whether we are running in iOS environment, and use appropriate APIs supported on iOS, otherwise fallback to APIs supported on Mac.
For other functionality, that is only supported on either system should be implemented as part of their respective systems (Mac Framework vs. iOS Framework)
Some types should be GeneratorType
s to support next()
, but complementary to still support things like tintForIndex(index: Int)
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.