{"action":"created","comment":{"url":"https://api.github.com/repos/angular/material/pulls/comments/24986370","id":24986370,"diff_hunk":"@@ -0,0 +1,129 @@\n+(function () {\n+    \"use strict\";\n+\n+    //module global to keep an reference to the dynamic style sheet\n+    var customSheet;\n+    //module global to available color pallettes\n+    var colorStore     = {};\n+    var defaultPalette = '';\n+\n+/**\n+ * @ngdoc service\n+ * @name $mdColors\n+ * @module material.core.color\n+ *\n+ * @description\n+ * `$mdColors` makes it possible to use the colors of any palette to be available\n+ *  as CSS rules in the form of md-bg-[colorname] and md-fg-[colorname] (as foreground and background)\n+ *  If you want to activate another palette you can use the $mdColor.loadPalette(palletteName) method.\n+ *\n+ *  the $mdColors.palettes array lists all available palettes\n+ *  the $mdColors.palette property lists the current selected palette\n+ *  the $mdColors.colors array lists all the available colors with hex encoded color values for the current selected palette.\n+ *\n+ **/\n+\n+\n+    angular\n+        .module('material.core.colors',['material.core.theming'])\n+        .service('$mdColors', mdColors)\n+        .config(configColors)\n+        .run(loadDefaults);\n+\n+    configColors.$inject = ['$mdThemingProvider'];\n+    function configColors($mdThemingProvider) {\n+        // fetch the colors out of the theming provider\n+        Object.keys($mdThemingProvider._PALETTES).forEach(parsePalette);\n+\n+        // I need access to the default 'default', hardcoded for now as I miss access to it.\n+        defaultPalette = $mdThemingProvider._THEMES['default'].colors.primary.name;\n+        return;\n+\n+        // clone the palette colors to the colorStore var\n+        function parsePalette(paletteName) {\n+            var palette = $mdThemingProvider._PALETTES[paletteName];\n+            var colors  = [];\n+            colorStore[paletteName] = colors;\n+            Object.keys(palette).forEach(copyColors);\n+            return ;\n+\n+            function copyColors(colorName) {\n+                // use an regex to look for hex colors, ignore the rest\n+                if (/#[0-9A-Fa-f]{6}|0-9A-Fa-f]{8}\\b/.exec(palette[colorName])) {","path":"src/core/services/theming/colors.js","position":52,"original_position":52,"commit_id":"1842bcb35a5eeb4063923cc0b35e500bfd821242","original_commit_id":"1842bcb35a5eeb4063923cc0b35e500bfd821242","user":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"body":"This RegExp seems wrong... Not sure what the second part is checking for, though.","created_at":"2015-02-19T13:20:46Z","updated_at":"2015-02-19T13:20:46Z","html_url":"https://github.com/angular/material/pull/1566#discussion_r24986370","pull_request_url":"https://api.github.com/repos/angular/material/pulls/1566","_links":{"self":{"href":"https://api.github.com/repos/angular/material/pulls/comments/24986370"},"html":{"href":"https://github.com/angular/material/pull/1566#discussion_r24986370"},"pull_request":{"href":"https://api.github.com/repos/angular/material/pulls/1566"}}},"pull_request":{"url":"https://api.github.com/repos/angular/material/pulls/1566","id":29608813,"html_url":"https://github.com/angular/material/pull/1566","diff_url":"https://github.com/angular/material/pull/1566.diff","patch_url":"https://github.com/angular/material/pull/1566.patch","issue_url":"https://api.github.com/repos/angular/material/issues/1566","number":1566,"state":"open","locked":false,"title":"Create colors.js for $mdColor service.","user":{"login":"SanderElias","id":1249083,"avatar_url":"https://avatars.githubusercontent.com/u/1249083?v=3","gravatar_id":"","url":"https://api.github.com/users/SanderElias","html_url":"https://github.com/SanderElias","followers_url":"https://api.github.com/users/SanderElias/followers","following_url":"https://api.github.com/users/SanderElias/following{/other_user}","gists_url":"https://api.github.com/users/SanderElias/gists{/gist_id}","starred_url":"https://api.github.com/users/SanderElias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SanderElias/subscriptions","organizations_url":"https://api.github.com/users/SanderElias/orgs","repos_url":"https://api.github.com/users/SanderElias/repos","events_url":"https://api.github.com/users/SanderElias/events{/privacy}","received_events_url":"https://api.github.com/users/SanderElias/received_events","type":"User","site_admin":false},"body":"A service to create css rules for foreground and background colors a talked about in #1269","created_at":"2015-02-19T12:54:20Z","updated_at":"2015-02-19T13:20:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d8720d749eae78489391742fbaa3dff912dc03b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/angular/material/pulls/1566/commits","review_comments_url":"https://api.github.com/repos/angular/material/pulls/1566/comments","review_comment_url":"https://api.github.com/repos/angular/material/pulls/comments/{number}","comments_url":"https://api.github.com/repos/angular/material/issues/1566/comments","statuses_url":"https://api.github.com/repos/angular/material/statuses/1842bcb35a5eeb4063923cc0b35e500bfd821242","head":{"label":"SanderElias:SanderElias-$mdColors","ref":"SanderElias-$mdColors","sha":"1842bcb35a5eeb4063923cc0b35e500bfd821242","user":{"login":"SanderElias","id":1249083,"avatar_url":"https://avatars.githubusercontent.com/u/1249083?v=3","gravatar_id":"","url":"https://api.github.com/users/SanderElias","html_url":"https://github.com/SanderElias","followers_url":"https://api.github.com/users/SanderElias/followers","following_url":"https://api.github.com/users/SanderElias/following{/other_user}","gists_url":"https://api.github.com/users/SanderElias/gists{/gist_id}","starred_url":"https://api.github.com/users/SanderElias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SanderElias/subscriptions","organizations_url":"https://api.github.com/users/SanderElias/orgs","repos_url":"https://api.github.com/users/SanderElias/repos","events_url":"https://api.github.com/users/SanderElias/events{/privacy}","received_events_url":"https://api.github.com/users/SanderElias/received_events","type":"User","site_admin":false},"repo":{"id":31014811,"name":"material","full_name":"SanderElias/material","owner":{"login":"SanderElias","id":1249083,"avatar_url":"https://avatars.githubusercontent.com/u/1249083?v=3","gravatar_id":"","url":"https://api.github.com/users/SanderElias","html_url":"https://github.com/SanderElias","followers_url":"https://api.github.com/users/SanderElias/followers","following_url":"https://api.github.com/users/SanderElias/following{/other_user}","gists_url":"https://api.github.com/users/SanderElias/gists{/gist_id}","starred_url":"https://api.github.com/users/SanderElias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SanderElias/subscriptions","organizations_url":"https://api.github.com/users/SanderElias/orgs","repos_url":"https://api.github.com/users/SanderElias/repos","events_url":"https://api.github.com/users/SanderElias/events{/privacy}","received_events_url":"https://api.github.com/users/SanderElias/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SanderElias/material","description":"Material design for Angular","fork":true,"url":"https://api.github.com/repos/SanderElias/material","forks_url":"https://api.github.com/repos/SanderElias/material/forks","keys_url":"https://api.github.com/repos/SanderElias/material/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SanderElias/material/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SanderElias/material/teams","hooks_url":"https://api.github.com/repos/SanderElias/material/hooks","issue_events_url":"https://api.github.com/repos/SanderElias/material/issues/events{/number}","events_url":"https://api.github.com/repos/SanderElias/material/events","assignees_url":"https://api.github.com/repos/SanderElias/material/assignees{/user}","branches_url":"https://api.github.com/repos/SanderElias/material/branches{/branch}","tags_url":"https://api.github.com/repos/SanderElias/material/tags","blobs_url":"https://api.github.com/repos/SanderElias/material/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SanderElias/material/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SanderElias/material/git/refs{/sha}","trees_url":"https://api.github.com/repos/SanderElias/material/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SanderElias/material/statuses/{sha}","languages_url":"https://api.github.com/repos/SanderElias/material/languages","stargazers_url":"https://api.github.com/repos/SanderElias/material/stargazers","contributors_url":"https://api.github.com/repos/SanderElias/material/contributors","subscribers_url":"https://api.github.com/repos/SanderElias/material/subscribers","subscription_url":"https://api.github.com/repos/SanderElias/material/subscription","commits_url":"https://api.github.com/repos/SanderElias/material/commits{/sha}","git_commits_url":"https://api.github.com/repos/SanderElias/material/git/commits{/sha}","comments_url":"https://api.github.com/repos/SanderElias/material/comments{/number}","issue_comment_url":"https://api.github.com/repos/SanderElias/material/issues/comments/{number}","contents_url":"https://api.github.com/repos/SanderElias/material/contents/{+path}","compare_url":"https://api.github.com/repos/SanderElias/material/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SanderElias/material/merges","archive_url":"https://api.github.com/repos/SanderElias/material/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SanderElias/material/downloads","issues_url":"https://api.github.com/repos/SanderElias/material/issues{/number}","pulls_url":"https://api.github.com/repos/SanderElias/material/pulls{/number}","milestones_url":"https://api.github.com/repos/SanderElias/material/milestones{/number}","notifications_url":"https://api.github.com/repos/SanderElias/material/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SanderElias/material/labels{/name}","releases_url":"https://api.github.com/repos/SanderElias/material/releases{/id}","created_at":"2015-02-19T12:45:15Z","updated_at":"2015-02-19T12:45:16Z","pushed_at":"2015-02-19T12:50:16Z","git_url":"git://github.com/SanderElias/material.git","ssh_url":"git@github.com:SanderElias/material.git","clone_url":"https://github.com/SanderElias/material.git","svn_url":"https://github.com/SanderElias/material","homepage":"https://material.angularjs.org/","size":79774,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"42cff135320727b3615c3cd00300c923112e142d","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":21399598,"name":"material","full_name":"angular/material","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/material","description":"Material design for Angular","fork":false,"url":"https://api.github.com/repos/angular/material","forks_url":"https://api.github.com/repos/angular/material/forks","keys_url":"https://api.github.com/repos/angular/material/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/material/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/material/teams","hooks_url":"https://api.github.com/repos/angular/material/hooks","issue_events_url":"https://api.github.com/repos/angular/material/issues/events{/number}","events_url":"https://api.github.com/repos/angular/material/events","assignees_url":"https://api.github.com/repos/angular/material/assignees{/user}","branches_url":"https://api.github.com/repos/angular/material/branches{/branch}","tags_url":"https://api.github.com/repos/angular/material/tags","blobs_url":"https://api.github.com/repos/angular/material/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/material/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/material/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/material/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/material/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/material/languages","stargazers_url":"https://api.github.com/repos/angular/material/stargazers","contributors_url":"https://api.github.com/repos/angular/material/contributors","subscribers_url":"https://api.github.com/repos/angular/material/subscribers","subscription_url":"https://api.github.com/repos/angular/material/subscription","commits_url":"https://api.github.com/repos/angular/material/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/material/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/material/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/material/issues/comments/{number}","contents_url":"https://api.github.com/repos/angular/material/contents/{+path}","compare_url":"https://api.github.com/repos/angular/material/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/material/merges","archive_url":"https://api.github.com/repos/angular/material/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/material/downloads","issues_url":"https://api.github.com/repos/angular/material/issues{/number}","pulls_url":"https://api.github.com/repos/angular/material/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/material/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/material/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/material/labels{/name}","releases_url":"https://api.github.com/repos/angular/material/releases{/id}","created_at":"2014-07-01T19:20:06Z","updated_at":"2015-02-19T13:04:57Z","pushed_at":"2015-02-19T05:16:26Z","git_url":"git://github.com/angular/material.git","ssh_url":"git@github.com:angular/material.git","clone_url":"https://github.com/angular/material.git","svn_url":"https://github.com/angular/material","homepage":"https://material.angularjs.org/","size":79774,"stargazers_count":6857,"watchers_count":6857,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":889,"mirror_url":null,"open_issues_count":277,"forks":889,"open_issues":277,"watchers":6857,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/material/pulls/1566"},"html":{"href":"https://github.com/angular/material/pull/1566"},"issue":{"href":"https://api.github.com/repos/angular/material/issues/1566"},"comments":{"href":"https://api.github.com/repos/angular/material/issues/1566/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/material/pulls/1566/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/material/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/angular/material/pulls/1566/commits"},"statuses":{"href":"https://api.github.com/repos/angular/material/statuses/1842bcb35a5eeb4063923cc0b35e500bfd821242"}}}}