{"id":18270830,"url":"https://github.com/peyton/MOOMaskedIconView","last_synced_at":"2025-04-05T01:30:52.168Z","repository":{"id":2500618,"uuid":"3475264","full_name":"peyton/MOOMaskedIconView","owner":"peyton","description":"Photoshop layer styles for iOS icons. Stop maintaining a separate file for each color, resolution, and style.","archived":false,"fork":false,"pushed_at":"2015-01-12T13:06:45.000Z","size":772,"stargazers_count":439,"open_issues_count":0,"forks_count":33,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-16T17:51:28.476Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peyton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-18T00:56:37.000Z","updated_at":"2024-09-22T17:35:21.000Z","dependencies_parsed_at":"2022-09-16T00:00:33.006Z","dependency_job_id":null,"html_url":"https://github.com/peyton/MOOMaskedIconView","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peyton%2FMOOMaskedIconView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peyton%2FMOOMaskedIconView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peyton%2FMOOMaskedIconView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peyton%2FMOOMaskedIconView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peyton","download_url":"https://codeload.github.com/peyton/MOOMaskedIconView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276043,"owners_count":20912286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:38:53.659Z","updated_at":"2025-04-05T01:30:51.420Z","avatar_url":"https://github.com/peyton.png","language":"Objective-C","readme":"![Masked Icons](https://s3.amazonaws.com/peyton.github.com/MOOMaskedIconView/Why.png)\n\n#Introduction\n----------\n\nMOOMaskedIconView is a UIView subclass that uses black-and-white masks to draw icons of different\nstyles at any size or resolution. It's like Photoshop layer styles, using the same technique as\nUITabBar to generate various effects from a single icon mask.\n\n![Tab bar icons](https://s3.amazonaws.com/peyton.github.com/MOOMaskedIconView/Sample-Bar-Cutaway.png)\n\nMOOMaskedIconView displays common image formats and PDFs, the native vector file format of iOS and\nOS X. PDFs are best—they're easy to maintain and resolution independent.\n\n#Examples\n---------\n\n###Create a green icon from a PNG\n\n    MOOMaskedIconView *iconView = [MOOMaskedIconView iconWithResourceNamed:@\"icon.png\"]\n    iconView.color = [UIColor greenColor];\n    [self.view addSubview:iconView];\n\n###Resize a PDF icon and add a reusable gradient trait\n\n    MOOStyleTrait *grayGradientTrait = [MOOStyleTrait trait];\n    grayGradientTrait.gradientColors = [NSArray arrayWithObjects:[UIColor colorWithWhite:0.7f alpha:1.0f],\n                                                                 [UIColor colorWithWhite:0.5f alpha:1.0f], nil];\n\n    MOOMaskedIconView *iconView = [MOOMaskedIconView iconWithPDFNamed:@\"icon.pdf\" size:CGSizeMake(32.0f, 26.0f)];\n    [iconView mixInTrait:grayGradientTrait];\n    [self.view addSubview:iconView];\n\n###Add an overlay and a shadow to a red icon\n\n    UIImage *overlay = [UIImage imageNamed:@\"overlay.png\"];\n    MOOMaskedIconView *iconView = [MOOMaskedIconView iconWithImageNamed:@\"icon.png\"];\n    iconView.color = [UIColor redColor];\n    iconView.overlay = overlay;\n    iconView.shadowColor = [UIColor darkGrayColor];\n    iconView.shadowOffset = CGSizeMake(3.0f, 3.0f);\n    [self.view addSubview:iconView];\n\n###Render a PDF icon into a UIButton\n\n    MOOMaskedIconView *iconView = [MOOMaskedIconView iconWithResourceNamed:@\"icon.pdf\"];\n    iconView.color = [UIColor magentaColor];\n    iconView.highlightedColor = [UIColor orangeColor];\n    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];\n    [button setImage:[iconView renderImage] forState:UIControlStateNormal]\n    [button setImage:[iconView renderHighlightedImage] forState:UIControlStateHighlighted];\n    [self.view addSubview:button];\n\nFor more examples, check out the [Demo Project](https://github.com/peyton/MOOMaskedIconView/tree/master/Demo%20Project).\n\nFor the full list of styleable properties, see [MOOMaskedIconViewStyles](http://peytn.com/MOOMaskedIconView/html/Protocols/MOOMaskedIconViewStyles.html).\n\nFor information on reusable styles, caching, and other advanced topics, see [*Advanced Use*](https://github.com/peyton/MOOMaskedIconView/wiki/Advanced-Use).\n\n#How to install\n-----------\n\n###First: Clone into a submodule\n\nIn your project's folder, type:\n\n    git submodule add git://github.com/peyton/MOOMaskedIconView.git\n\nA submodule allows your repository to contain a clone of an external\nproject. If you don't want a submodule, use:\n\n    git clone git://github.com/peyton/MOOMaskedIconView.git\n\n###Next: Add classes\n\nDrag `MOOMaskedIconView/` into your Xcode project's file browser.\n\n*Note:* An options dialog will pop up. If you're using MOOMaskedIconView as a submodule,\nyou should uncheck \"Copy items into destination group's folder (if needed).\"\n\n###Then: Add Accelerate.framework\n\n![Accelerate.framework process](https://s3.amazonaws.com/peyton.github.com/MOOMaskedIconView/AddAccelerateFramework.png)\n\nWith your application's target selected in the navigator, click on the \"Build Phases\" tab. Under \"Link Binary With Libraries,\" click the \"+\" button and add `Accelerate.framework`.\n\n###Finally: Import the header\n\n    #import \"MOOMaskedIconView.h\"\n\n###Later: Update to the latest version\n\n`cd` into the MOOMaskedIconView directory and run:\n\n    git pull\n\n#Creating image masks\n---------\n\n![Image mask process](https://s3.amazonaws.com/peyton.github.com/MOOMaskedIconView/Mask.png)\n\nAn image mask is a black-and-white image that clips drawing. Quartz clipping follows three simple rules:\n\n* Black pixels render opaquely.\n* White pixels render transparently.\n* Gray pixels render with an alpha value of 1 - *source pixel's gray value*.\n\nMask images may not use an alpha channel, so icons with transparency must be set on a white background. For more information about Quartz image masking, see\nthe [Quartz 2D Programming Guide](https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_images/dq_images.html%23//apple_ref/doc/uid/TP30001066-CH212-CJBHDDBE).\n\n#Scalable icons with PDFs\n---------\n\nMOOMaskedIconView makes it easy to use PDFs as icons, eliminating \"\\*@2x.\\*\" files.\nMany Apple applications on OS X use PDF icons for resolution independence.\n\nNext to the network, the biggest source of latency on an iPhone is the disk. For small, simple icons the PDF format adds a few KB of overhead over PNG.\nBecause the iPhone loads data in chunks, in practice the difference in loading time is nothing. For larger icons a PDF of vectors can *save* space.\n\nSome editors need a little massaging to export PDFs suitable for\niOS icons. How-to instructions are [here](https://github.com/peyton/MOOMaskedIconView/wiki/Exporting-PDFs).\n\n#Contributing\n--------\n\nForks, patches, and other suggestions are always welcome and addressed as quickly as possible. Here's a [quick guide](https://github.com/peyton/MOOMaskedIconView/wiki/Contributing) to the process.\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeyton%2FMOOMaskedIconView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeyton%2FMOOMaskedIconView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeyton%2FMOOMaskedIconView/lists"}