Skip to content

Category for UIImage to colorize it. Perfect for changing the color of a glyph with a neutral color.

License

Notifications You must be signed in to change notification settings

sammcewan/UIImage-Color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UIImage-Color

A couple of useful category methods relating to UIImage and colour.

Colorization

Category for UIImage to colorize it. Perfect for changing the color of a glyph with a neutral color.

To use simply invoke with -

    _imageView.image = [_disclosureImage cl_changeColor:[UIColor greenColor]];

Supports both retina and regular display scales.

Tiny Image

Creates a tiny image of a certain color, allowing it to be used when color states are not an option such as UIButton.

    [btn setBackgroundImage:[UIImage cl_imageWithColor:[UIColor grey]] forState:UIControlStateDisabled];  
    [btn setBackgroundImage:[UIImage cl_imageWithColor:[UIColor red]] forState:UIControlStateNormal];  
    [btn setBackgroundImage:[UIImage cl_imageWithColor:[UIColor black]] forState:UIControlStateHighlighted];  

Note: Some parts of these snippets have been floating around in one form or another. Keen to attribute them to their original owner.

About

Category for UIImage to colorize it. Perfect for changing the color of a glyph with a neutral color.

Resources

License

Stars

Watchers

Forks

Packages

No packages published