{"action":"created","comment":{"url":"https://api.github.com/repos/bram85/topydo/pulls/comments/31394525","id":31394525,"diff_hunk":"@@ -186,6 +193,49 @@ def hidden_tags(self):\n         hidden_tags = self.cp.get('ls', 'hide_tags')\n         return [] if hidden_tags == '' else hidden_tags.split(',')\n \n+    def priority_colors(self):\n+        \"\"\" Returns a dict with priorities as keys and color numbers as value. \"\"\"\n+        pri_colors_str = self.cp.get('colorscheme', 'priority_colors')\n+\n+        def _str_to_dict(p_string):\n+            pri_colors_dict = dict()\n+            for pri_color in pri_colors_str.split(','):","path":"topydo/lib/Config.py","position":null,"original_position":33,"commit_id":"59296a5fd3c1ed936d93c376d3fb1e7e0df55750","original_commit_id":"eae97cce5793e0a001d5d19a326dd9883fbcf111","user":{"login":"mruwek","id":500710,"avatar_url":"https://avatars.githubusercontent.com/u/500710?v=3","gravatar_id":"","url":"https://api.github.com/users/mruwek","html_url":"https://github.com/mruwek","followers_url":"https://api.github.com/users/mruwek/followers","following_url":"https://api.github.com/users/mruwek/following{/other_user}","gists_url":"https://api.github.com/users/mruwek/gists{/gist_id}","starred_url":"https://api.github.com/users/mruwek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruwek/subscriptions","organizations_url":"https://api.github.com/users/mruwek/orgs","repos_url":"https://api.github.com/users/mruwek/repos","events_url":"https://api.github.com/users/mruwek/events{/privacy}","received_events_url":"https://api.github.com/users/mruwek/received_events","type":"User","site_admin":false},"body":"> Instead, I would expect +blue to turn up... well... blue.\r\n\r\nYou're right. I'll try to implement it. I'm thinking about something like this:\r\n\r\n```python\r\ndef get_project_color(self):\r\n        if self.project_color == '':\r\n            return ''\r\n        else:\r\n            return self._get_ansi(self.project_color, 'bold')\r\n```\r\n\r\nThis way project_color wouldn't add any ansi to output, so `+project` should retain previously defined color, which should be priority_color or NEUTRAL_COLOR (if priority_color is undefined). I'll try it out and send patch in short time.\r\n\r\n> Returning to your question for the priorities, that would mean that all todo items will appear neutrally colored when they upgrade topydo, since they don't have a configuration file where priority_colors is defined.","created_at":"2015-05-31T21:24:21Z","updated_at":"2015-05-31T21:24:21Z","html_url":"https://github.com/bram85/topydo/pull/27#discussion_r31394525","pull_request_url":"https://api.github.com/repos/bram85/topydo/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/bram85/topydo/pulls/comments/31394525"},"html":{"href":"https://github.com/bram85/topydo/pull/27#discussion_r31394525"},"pull_request":{"href":"https://api.github.com/repos/bram85/topydo/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/bram85/topydo/pulls/27","id":36063227,"html_url":"https://github.com/bram85/topydo/pull/27","diff_url":"https://github.com/bram85/topydo/pull/27.diff","patch_url":"https://github.com/bram85/topydo/pull/27.patch","issue_url":"https://api.github.com/repos/bram85/topydo/issues/27","number":27,"state":"open","locked":false,"title":"Add possibility to configure colorscheme of topydo","user":{"login":"mruwek","id":500710,"avatar_url":"https://avatars.githubusercontent.com/u/500710?v=3","gravatar_id":"","url":"https://api.github.com/users/mruwek","html_url":"https://github.com/mruwek","followers_url":"https://api.github.com/users/mruwek/followers","following_url":"https://api.github.com/users/mruwek/following{/other_user}","gists_url":"https://api.github.com/users/mruwek/gists{/gist_id}","starred_url":"https://api.github.com/users/mruwek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruwek/subscriptions","organizations_url":"https://api.github.com/users/mruwek/orgs","repos_url":"https://api.github.com/users/mruwek/repos","events_url":"https://api.github.com/users/mruwek/events{/privacy}","received_events_url":"https://api.github.com/users/mruwek/received_events","type":"User","site_admin":false},"body":"- Add new module `topydo.lib.Colors` and class `Colors` for handling output colors and their ANSI codes.\r\n- Create new config options with colors for priorities, projects, contexts, metadata, and links and place them under new section called \"colorscheme\".\r\n\r\nEach configurable color is a number from range 0-255 and corresponds with relevant position in [xterm color chart](http://en.wikipedia.org/wiki/File:Xterm_256color_chart.svg). Link, metadata, project, and context colors are configured as in example below:\r\n\r\n`link_color = 1`\r\n\r\n Priority colors are defined in one string, where `priority:color_number` pairs are separated by commas. Number of defined priority colors and their order in configuration string are totally arbitrary. For example:\r\n\r\n`priority_colors = A:1,B:2,C:3,Z:4,D:27`","created_at":"2015-05-22T19:48:55Z","updated_at":"2015-05-31T21:24:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7579276384b09c3ad965dc1891df7ff1a28f8776","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bram85/topydo/pulls/27/commits","review_comments_url":"https://api.github.com/repos/bram85/topydo/pulls/27/comments","review_comment_url":"https://api.github.com/repos/bram85/topydo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bram85/topydo/issues/27/comments","statuses_url":"https://api.github.com/repos/bram85/topydo/statuses/59296a5fd3c1ed936d93c376d3fb1e7e0df55750","head":{"label":"mruwek:colorscheme","ref":"colorscheme","sha":"59296a5fd3c1ed936d93c376d3fb1e7e0df55750","user":{"login":"mruwek","id":500710,"avatar_url":"https://avatars.githubusercontent.com/u/500710?v=3","gravatar_id":"","url":"https://api.github.com/users/mruwek","html_url":"https://github.com/mruwek","followers_url":"https://api.github.com/users/mruwek/followers","following_url":"https://api.github.com/users/mruwek/following{/other_user}","gists_url":"https://api.github.com/users/mruwek/gists{/gist_id}","starred_url":"https://api.github.com/users/mruwek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruwek/subscriptions","organizations_url":"https://api.github.com/users/mruwek/orgs","repos_url":"https://api.github.com/users/mruwek/repos","events_url":"https://api.github.com/users/mruwek/events{/privacy}","received_events_url":"https://api.github.com/users/mruwek/received_events","type":"User","site_admin":false},"repo":{"id":28913515,"name":"topydo","full_name":"mruwek/topydo","owner":{"login":"mruwek","id":500710,"avatar_url":"https://avatars.githubusercontent.com/u/500710?v=3","gravatar_id":"","url":"https://api.github.com/users/mruwek","html_url":"https://github.com/mruwek","followers_url":"https://api.github.com/users/mruwek/followers","following_url":"https://api.github.com/users/mruwek/following{/other_user}","gists_url":"https://api.github.com/users/mruwek/gists{/gist_id}","starred_url":"https://api.github.com/users/mruwek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruwek/subscriptions","organizations_url":"https://api.github.com/users/mruwek/orgs","repos_url":"https://api.github.com/users/mruwek/repos","events_url":"https://api.github.com/users/mruwek/events{/privacy}","received_events_url":"https://api.github.com/users/mruwek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mruwek/topydo","description":"A command-line todo list application based on the todo.txt format.","fork":true,"url":"https://api.github.com/repos/mruwek/topydo","forks_url":"https://api.github.com/repos/mruwek/topydo/forks","keys_url":"https://api.github.com/repos/mruwek/topydo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mruwek/topydo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mruwek/topydo/teams","hooks_url":"https://api.github.com/repos/mruwek/topydo/hooks","issue_events_url":"https://api.github.com/repos/mruwek/topydo/issues/events{/number}","events_url":"https://api.github.com/repos/mruwek/topydo/events","assignees_url":"https://api.github.com/repos/mruwek/topydo/assignees{/user}","branches_url":"https://api.github.com/repos/mruwek/topydo/branches{/branch}","tags_url":"https://api.github.com/repos/mruwek/topydo/tags","blobs_url":"https://api.github.com/repos/mruwek/topydo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mruwek/topydo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mruwek/topydo/git/refs{/sha}","trees_url":"https://api.github.com/repos/mruwek/topydo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mruwek/topydo/statuses/{sha}","languages_url":"https://api.github.com/repos/mruwek/topydo/languages","stargazers_url":"https://api.github.com/repos/mruwek/topydo/stargazers","contributors_url":"https://api.github.com/repos/mruwek/topydo/contributors","subscribers_url":"https://api.github.com/repos/mruwek/topydo/subscribers","subscription_url":"https://api.github.com/repos/mruwek/topydo/subscription","commits_url":"https://api.github.com/repos/mruwek/topydo/commits{/sha}","git_commits_url":"https://api.github.com/repos/mruwek/topydo/git/commits{/sha}","comments_url":"https://api.github.com/repos/mruwek/topydo/comments{/number}","issue_comment_url":"https://api.github.com/repos/mruwek/topydo/issues/comments{/number}","contents_url":"https://api.github.com/repos/mruwek/topydo/contents/{+path}","compare_url":"https://api.github.com/repos/mruwek/topydo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mruwek/topydo/merges","archive_url":"https://api.github.com/repos/mruwek/topydo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mruwek/topydo/downloads","issues_url":"https://api.github.com/repos/mruwek/topydo/issues{/number}","pulls_url":"https://api.github.com/repos/mruwek/topydo/pulls{/number}","milestones_url":"https://api.github.com/repos/mruwek/topydo/milestones{/number}","notifications_url":"https://api.github.com/repos/mruwek/topydo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mruwek/topydo/labels{/name}","releases_url":"https://api.github.com/repos/mruwek/topydo/releases{/id}","created_at":"2015-01-07T12:27:57Z","updated_at":"2015-02-07T11:40:50Z","pushed_at":"2015-05-31T16:38:50Z","git_url":"git://github.com/mruwek/topydo.git","ssh_url":"git@github.com:mruwek/topydo.git","clone_url":"https://github.com/mruwek/topydo.git","svn_url":"https://github.com/mruwek/topydo","homepage":"","size":982,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"stable"}},"base":{"label":"bram85:master","ref":"master","sha":"2e0b6ae7a2b87697f994e8fa9a376f60dc71fe81","user":{"login":"bram85","id":63248,"avatar_url":"https://avatars.githubusercontent.com/u/63248?v=3","gravatar_id":"","url":"https://api.github.com/users/bram85","html_url":"https://github.com/bram85","followers_url":"https://api.github.com/users/bram85/followers","following_url":"https://api.github.com/users/bram85/following{/other_user}","gists_url":"https://api.github.com/users/bram85/gists{/gist_id}","starred_url":"https://api.github.com/users/bram85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bram85/subscriptions","organizations_url":"https://api.github.com/users/bram85/orgs","repos_url":"https://api.github.com/users/bram85/repos","events_url":"https://api.github.com/users/bram85/events{/privacy}","received_events_url":"https://api.github.com/users/bram85/received_events","type":"User","site_admin":false},"repo":{"id":25428376,"name":"topydo","full_name":"bram85/topydo","owner":{"login":"bram85","id":63248,"avatar_url":"https://avatars.githubusercontent.com/u/63248?v=3","gravatar_id":"","url":"https://api.github.com/users/bram85","html_url":"https://github.com/bram85","followers_url":"https://api.github.com/users/bram85/followers","following_url":"https://api.github.com/users/bram85/following{/other_user}","gists_url":"https://api.github.com/users/bram85/gists{/gist_id}","starred_url":"https://api.github.com/users/bram85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bram85/subscriptions","organizations_url":"https://api.github.com/users/bram85/orgs","repos_url":"https://api.github.com/users/bram85/repos","events_url":"https://api.github.com/users/bram85/events{/privacy}","received_events_url":"https://api.github.com/users/bram85/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bram85/topydo","description":"A command-line todo list application using the todo.txt format.","fork":false,"url":"https://api.github.com/repos/bram85/topydo","forks_url":"https://api.github.com/repos/bram85/topydo/forks","keys_url":"https://api.github.com/repos/bram85/topydo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bram85/topydo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bram85/topydo/teams","hooks_url":"https://api.github.com/repos/bram85/topydo/hooks","issue_events_url":"https://api.github.com/repos/bram85/topydo/issues/events{/number}","events_url":"https://api.github.com/repos/bram85/topydo/events","assignees_url":"https://api.github.com/repos/bram85/topydo/assignees{/user}","branches_url":"https://api.github.com/repos/bram85/topydo/branches{/branch}","tags_url":"https://api.github.com/repos/bram85/topydo/tags","blobs_url":"https://api.github.com/repos/bram85/topydo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bram85/topydo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bram85/topydo/git/refs{/sha}","trees_url":"https://api.github.com/repos/bram85/topydo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bram85/topydo/statuses/{sha}","languages_url":"https://api.github.com/repos/bram85/topydo/languages","stargazers_url":"https://api.github.com/repos/bram85/topydo/stargazers","contributors_url":"https://api.github.com/repos/bram85/topydo/contributors","subscribers_url":"https://api.github.com/repos/bram85/topydo/subscribers","subscription_url":"https://api.github.com/repos/bram85/topydo/subscription","commits_url":"https://api.github.com/repos/bram85/topydo/commits{/sha}","git_commits_url":"https://api.github.com/repos/bram85/topydo/git/commits{/sha}","comments_url":"https://api.github.com/repos/bram85/topydo/comments{/number}","issue_comment_url":"https://api.github.com/repos/bram85/topydo/issues/comments{/number}","contents_url":"https://api.github.com/repos/bram85/topydo/contents/{+path}","compare_url":"https://api.github.com/repos/bram85/topydo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bram85/topydo/merges","archive_url":"https://api.github.com/repos/bram85/topydo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bram85/topydo/downloads","issues_url":"https://api.github.com/repos/bram85/topydo/issues{/number}","pulls_url":"https://api.github.com/repos/bram85/topydo/pulls{/number}","milestones_url":"https://api.github.com/repos/bram85/topydo/milestones{/number}","notifications_url":"https://api.github.com/repos/bram85/topydo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bram85/topydo/labels{/name}","releases_url":"https://api.github.com/repos/bram85/topydo/releases{/id}","created_at":"2014-10-19T13:49:43Z","updated_at":"2015-05-28T07:59:06Z","pushed_at":"2015-05-31T21:10:08Z","git_url":"git://github.com/bram85/topydo.git","ssh_url":"git@github.com:bram85/topydo.git","clone_url":"https://github.com/bram85/topydo.git","svn_url":"https://github.com/bram85/topydo","homepage":"","size":2219,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":7,"forks":4,"open_issues":7,"watchers":9,"default_branch":"stable"}},"_links":{"self":{"href":"https://api.github.com/repos/bram85/topydo/pulls/27"},"html":{"href":"https://github.com/bram85/topydo/pull/27"},"issue":{"href":"https://api.github.com/repos/bram85/topydo/issues/27"},"comments":{"href":"https://api.github.com/repos/bram85/topydo/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/bram85/topydo/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/bram85/topydo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bram85/topydo/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/bram85/topydo/statuses/59296a5fd3c1ed936d93c376d3fb1e7e0df55750"}}}}