• Stars
    star
    205
  • Rank 191,264 (Top 4 %)
  • Language
    Objective-C
  • License
    BSD 3-Clause "New...
  • Created about 11 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of UIColor categories and helper APIs for picking colors and generating color schemes. Bring life and beauty into your iOS application through dynamic user interfaces.

#Colors

Important: This is preliminary documentation for an API and technology in development. This information is subject to change. This document may be updated with future developments of the API and technology.

Contents:

###Introduction

Colors is a collection of UIColor categories and helper APIs for picking colors and generating color schemes. Bring life and beauty into your iOS application through dynamic user interfaces.

If you're using this in your project, I'd love to hear about it! Email me and tell me how you're using it.

###Demo

Included in the repo are demo applications (located in "Demo Apps" folder in the repo's root directory) showing off what this framework can do for your application. Note: All apps are not fully functional and are for demonstration purposes only.

Demo application using these APIs

In this demo music application, key colors are grabbed from the album artwork and displayed across the rest of the UI on the currently presented view controller.

The code necessary for the color part of application shown above is simple. When the song changes, it calls refreshColors: on the now playing view controller (_iv is the UIImageView containing the album art).

- (void)refreshColors
{
	UIColor *keyColor = [_iv.image keyColorToContrastAgainstColors:@[[UIColor whiteColor]]
	                                           withMinimumContrast:UIColorContrastLevelLow];
	if ( keyColor ) {
		[[UIApplication sharedApplication] keyWindow].tintColor = keyColor;
	} else {
		UIColor *bg = [_iv.image backgroundColorToContrastAgainstColors:@[[UIColor whiteColor],
		                                                                  [UIColor lightGrayColor]]
		                                            withMinimumContrast:UIColorContrastLevelLow];
		if ( !bg ) bg = [UIColor blackColor];
		[[UIApplication sharedApplication] keyWindow].tintColor = [UIColor neueBlue];
		_trackSlider.tintColor = bg;
		_volumeSlider.tintColor = bg;
	}
}

This method will search the image for a key-color appropriate color for use on a white background. If a sufficient color is not found, it returns nil. The case where the return value is nil is handled by doing a search for a general background-color to contrast against the white background and be different than the light gray color of the maximum slider component (right-side of sliders). The background defaults to black in the rare case no color data is found from image. The background color can be applied to the sliders because there are no key-color requirements. The buttons must have a key color appropriate tint color, so a default blue is used in that situation.

###Contributing

There are, of course, tons of changes, improvements, and simplifications I've been thinking about and may integrate in the future. I'm only one person, so any contributions are much appreciated.

To report any bugs not mentioned in the Notes and Known Issues section, use the Github Issue Tracker on the repo's Github page (https://github.com/mdznr/Colors/issues).

Feel free to go through the issue tracker to find and fix issues and enhancements to the project. Email me with any questions you may have. Then, submit a pull request. Thank you for helping out!

###Documentation

Documentation coming soon (once issue with appledoc is resolved).

###Adding the Colors framework to your project

#####Option 1 (Use framework as-is): If you just wish to add the framework at it's current state to your project, simply drag and drop Colors.framework (located in the repo's root directory) to the Project Navigator in Xcode.

Adding Framework to Project

Then, just add -ObjC and -all_load to Other Linker Flags in your Xcode Project. (This makes sure that the categories in the framework attach to the classes in other frameworks

Adding Other Linker Flags

Any future updates to the framework require the framework file to be manually replaced.

If you are still having issues, try looking one of the including demo apps (In the "Demo Apps" folder in the repo's root directory)

#####Option 2 (Modify framework and use): If you wish to modify the framework, or are doing development on the framework itself, and want to use it in an application, you must build the Framework Project (Framework Project/Colors.xcodeproj) yourself.

  1. After building the project, right-click on libColors.a under Products in the Project Navigator in Xcode.

  2. In that same directory, there should be a file named Colors.framework.

  3. Move and replace Colors.framework to the root of the Colors repo. Use this framework in your app. Note: At this point in time, this must be done manually after each change.

###Using the Colors Framework in your project

To use the Colors framework, simply add the following line to your source file:

#import <Colors/Colors.h>

You can also import individual files instead of the whole framework (for faster compile times) by doing something like:

#import <Colors/UIColor+NeueColors.h>

More Repositories

1

What-s-New

Easily present the latest changes and features to your users on app updates.
Objective-C
1,156
star
2

Sketch-Xcode

Automatically Exporting Assets from Sketch into Xcode.
Objective-C
160
star
3

MTZRadialMenu

A radial menu for iOS, like the one introduced in Messages for iOS 8.
Objective-C
141
star
4

MTZTiltReflectionSlider

UISlider subclass mimicking and improving the tilt controlled slider added to Music.app in iOS 6
Objective-C
84
star
5

NetworkActivityIndicator

Easily work with the network activity indicator in the iOS status bar. UIApplication category and demo app.
Objective-C
54
star
6

Handedness

Determine handedness of a UIPinchGestureRecognizer
Objective-C
40
star
7

Keyboard

I have always had a lot of opinions on software keyboards, so I need to make my own custom keyboard.
Swift
36
star
8

Spring-Animation

A simple iOS app to demonstrate UIView spring animations.
Objective-C
32
star
9

iOS-Passcode

Passcode app for iOS
Objective-C
16
star
10

MTZTextField

Fixing an issue with `UITextField` where the highlighted state of the text field's clear button is always the default blue, and not the tint color of the text field.
Objective-C
15
star
11

Blog.txt

Plaintext to web-based blog.
PHP
14
star
12

MTZSplitViewController

Fixing API of `UISplitViewController`.
Objective-C
12
star
13

Sonar

A Native Mac App for Apple's Bug Reporter
Objective-C
9
star
14

Goodnight

An iOS app that tells you when to wake up or fall asleep based on 90 minute sleep cycles.
Objective-C
7
star
15

replace_icns

Replace application icons from the command line.
Python
4
star
16

PushBackControl

When interacting with a control, it "pushes back" and responds with realtime feedback.
Objective-C
4
star
17

SmartCrop

More intelligently crop photos.
Objective-C
3
star
18

Safari-Passcode

Create a nice Safari extension for the passcode generator tool
3
star
19

Honeycrisp

Honeycrisp is a collection of advanced user interface controls and tools built on top of the iOS SDK.
2
star
20

dotfiles

Shell
2
star
21

Rewritten-APIs

Rewriting the APIs of classes in UIKit (like UIActionSheet and UIAlertView) to make them more sensical and easier to use.
Objective-C
2
star
22

WWDC-2014-Scholarship-Application

My submission for the WWDC 2014 Scholarship. https://developer.apple.com/wwdc/students/
Objective-C
2
star
23

Cloud

A simple, easy-to-use, file management system.
PHP
1
star
24

Computer-or-Fridge

Computer or Fridge?
1
star
25

Instapaper

Read Later Contextual Menu
JavaScript
1
star
26

Proxy-Server

Proxy Server assignment for Network Programming.
C
1
star
27

SwipeToMoveCursor

Objective-C
1
star
28

Icon-Launchers

Mini dummy apps with replacement icons that launch the real app. This isn't practical for anything.
Objective-C
1
star
29

Slide-To-Reveal-Control

Control for Passcodes that reveals a hidden work in a field with a magnifying glass.
Objective-C
1
star