Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sephiroth87/crayons
An Xcode plugin to improve dealing with colors in your project
https://github.com/sephiroth87/crayons
Last synced: about 7 hours ago
JSON representation
An Xcode plugin to improve dealing with colors in your project
- Host: GitHub
- URL: https://github.com/sephiroth87/crayons
- Owner: Sephiroth87
- License: mit
- Created: 2015-10-13T18:18:46.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-01T11:45:48.000Z (over 8 years ago)
- Last Synced: 2024-10-31T14:36:24.125Z (7 days ago)
- Language: Objective-C
- Size: 422 KB
- Stars: 475
- Watchers: 15
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**Crayons** is an Xcode7 plugin with various features that improve working with colors in your projects
##Code palettes (iOS only)
You can share palettes of colors from your source files, and use them directly in Interface Builder, without having to manually recreate them in the Color Picker.
And if you decide to change a color, you just need to change it's implementation.
Colors are generated dynamically, so you can use any method or calculation you need.
Because of that, project has to built to get updated colors, so it might take a while before they are updated in IB after a code change.####Usage
Define a palette by adding the class method
```
+ (NSString *)paletteName
class func paletteName() -> String
```to any class (Class has to derive from NSObject at some level, so no pure Swift classes at the moment).
To define a color, add a class method or variable with any name that returns UIColor, for example```
+ (UIColor *)colorName
class func colorName() -> UIColor
class var colorName: UIColor
```Only methods with no parameters are supported at the moment, and only UIColors in the RGB and White color space (so no `colorWithPatternImage:`)
You can then create a category/extension of you palette class, to create a separate palette with the same name plus the category name (look at `GooglePalette` and `GooglePalette+Accents` in the example project)
`UIColor` categories (like [Chameleon](https://github.com/ViccAlexander/Chameleon) will also generate palettes automatically.
Look at the example project for more infos.
##Upcoming features
* Colors validation (show IB warnings if using colors not defined in any palette)
* OSX support?
* More ways to define palettes/colors
* Show status of colors generations / indexing
* Any feature you think could be useful? Contact me ([@Sephiroth87](https://twitter.com/Sephiroth87))##Installation
- Clone and build the project
- Use [Alcatraz](https://github.com/supermarin/Alcatraz)Either way, restart Xcode to make it load
##Release notes
###1.3
- Add support for Swift class variables###1.2
- Xcode 7.3 support
- Improved internal logic + bugfixes###1.1
- You can now use categories/extensions for secondary palettes, and automatic UIColor palettes###1.0
- Initial Release
- Code palettes for iOS##License
Copyright (c) 2015. [Fabio Ritrovato](https://twitter.com/Sephiroth87)Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.