Coder Social home page Coder Social logo

chroma's Introduction

chroma's People

Contributors

chrene avatar fnky avatar

Watchers

 avatar  avatar  avatar

chroma's Issues

Add operators for types

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

Addition

Add component a.startColor to b.startColor, and (if not nil) a.endColor to b.endColor.

var c: ColorTint = a + b

Subtraction

Subtract component a.startColor from b.startColor, and (if not nil) a.endColor from b.endColor.

var c: ColorTint = a - b

Compare

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

Implement algorithm to generate from and to color

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.

Support for iOS & Mac

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)

Add complementary generators

Some types should be GeneratorTypes to support next(), but complementary to still support things like tintForIndex(index: Int).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.