{"action":"created","issue":{"url":"https://api.github.com/repos/godaddy/wp-primer-theme/issues/73","repository_url":"https://api.github.com/repos/godaddy/wp-primer-theme","labels_url":"https://api.github.com/repos/godaddy/wp-primer-theme/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/godaddy/wp-primer-theme/issues/73/comments","events_url":"https://api.github.com/repos/godaddy/wp-primer-theme/issues/73/events","html_url":"https://github.com/godaddy/wp-primer-theme/issues/73","id":171772767,"number":73,"title":"Error gracefully when a color scheme contains undefined colors","user":{"login":"fjarrett","id":522158,"avatar_url":"https://avatars.githubusercontent.com/u/522158?v=3","gravatar_id":"","url":"https://api.github.com/users/fjarrett","html_url":"https://github.com/fjarrett","followers_url":"https://api.github.com/users/fjarrett/followers","following_url":"https://api.github.com/users/fjarrett/following{/other_user}","gists_url":"https://api.github.com/users/fjarrett/gists{/gist_id}","starred_url":"https://api.github.com/users/fjarrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjarrett/subscriptions","organizations_url":"https://api.github.com/users/fjarrett/orgs","repos_url":"https://api.github.com/users/fjarrett/repos","events_url":"https://api.github.com/users/fjarrett/events{/privacy}","received_events_url":"https://api.github.com/users/fjarrett/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/godaddy/wp-primer-theme/labels/bug","name":"bug","color":"ee0701"}],"state":"open","locked":false,"assignee":{"login":"jonathanbardo","id":1933681,"avatar_url":"https://avatars.githubusercontent.com/u/1933681?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathanbardo","html_url":"https://github.com/jonathanbardo","followers_url":"https://api.github.com/users/jonathanbardo/followers","following_url":"https://api.github.com/users/jonathanbardo/following{/other_user}","gists_url":"https://api.github.com/users/jonathanbardo/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanbardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanbardo/subscriptions","organizations_url":"https://api.github.com/users/jonathanbardo/orgs","repos_url":"https://api.github.com/users/jonathanbardo/repos","events_url":"https://api.github.com/users/jonathanbardo/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanbardo/received_events","type":"User","site_admin":false},"assignees":[{"login":"jonathanbardo","id":1933681,"avatar_url":"https://avatars.githubusercontent.com/u/1933681?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathanbardo","html_url":"https://github.com/jonathanbardo","followers_url":"https://api.github.com/users/jonathanbardo/followers","following_url":"https://api.github.com/users/jonathanbardo/following{/other_user}","gists_url":"https://api.github.com/users/jonathanbardo/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanbardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanbardo/subscriptions","organizations_url":"https://api.github.com/users/jonathanbardo/orgs","repos_url":"https://api.github.com/users/jonathanbardo/repos","events_url":"https://api.github.com/users/jonathanbardo/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanbardo/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-08-17T22:08:48Z","updated_at":"2016-08-18T15:59:24Z","closed_at":null,"body":"Let's say you only have 2 colors defined in the `primer_colors` array of your child theme:\r\n\r\n```php\r\narray(\r\n\t'background_color' => array(\r\n\t\t'label'   => 'Background Color',\r\n\t\t'default' => '#fff',\r\n\t\t'css'     => array( ... ),\r\n\t),\r\n\t'text_color' => array(\r\n\t\t'label'   => 'Text Color',\r\n\t\t'default' => '#000',\r\n\t\t'css'     => array( ... ),\r\n\t),\r\n);\r\n```\r\n\r\nBut you have 3 colors defined in a scheme called `sepia` on the `primer_color_schemes` filter:\r\n\r\n```php\r\narray(\r\n\t'sepia' => array(\r\n\t\t'label'  => 'Sepia',\r\n\t\t'colors' => array(\r\n\t\t\t'background_color' => '#efece4',\r\n\t\t\t'text_color'       => '#eda246',\r\n\t\t\t'link_color'       => '#e54447',\r\n\t\t),\r\n\t),\r\n);\r\n```\r\n\r\nWhen you attempt to change the color scheme no swatches will change and it will result in a console error because `link_color` is not defined in `primer_colors`:\r\n\r\n```\r\nUncaught TypeError: api(...) is not a function in color-scheme-control.js?ver=1.0.0:103\r\n```\r\n\r\nIMO these errors should be graceful and still allow the colors that _do exist_ to be updated. This will give us the ability to add/remove colors from Primer in the future and maintain partial backwards compatibility with Child Themes without breaking the feature."},"comment":{"url":"https://api.github.com/repos/godaddy/wp-primer-theme/issues/comments/240770255","html_url":"https://github.com/godaddy/wp-primer-theme/issues/73#issuecomment-240770255","issue_url":"https://api.github.com/repos/godaddy/wp-primer-theme/issues/73","id":240770255,"user":{"login":"jonathanbardo","id":1933681,"avatar_url":"https://avatars.githubusercontent.com/u/1933681?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathanbardo","html_url":"https://github.com/jonathanbardo","followers_url":"https://api.github.com/users/jonathanbardo/followers","following_url":"https://api.github.com/users/jonathanbardo/following{/other_user}","gists_url":"https://api.github.com/users/jonathanbardo/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanbardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanbardo/subscriptions","organizations_url":"https://api.github.com/users/jonathanbardo/orgs","repos_url":"https://api.github.com/users/jonathanbardo/repos","events_url":"https://api.github.com/users/jonathanbardo/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanbardo/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T15:59:24Z","updated_at":"2016-08-18T15:59:24Z","body":"@fjarrett Sounds fair, should be a simple fix\r\n"}}
{"actor":{"display_login":"jonathanbardo"}}