Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
136cd8be
Commit
136cd8be
authored
Jul 19, 2017
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show a grey progress color for completed items
parent
19fe7d34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
topydo/lib/ProgressColor.py
topydo/lib/ProgressColor.py
+6
-2
No files found.
topydo/lib/ProgressColor.py
View file @
136cd8be
...
...
@@ -33,7 +33,7 @@ def progress_color(p_todo):
1
,
# red
]
# https://
upload.wikimedia.org/wikipedia/en/1/15/
Xterm_256color_chart.svg
# https://
commons.wikimedia.org/wiki/File:
Xterm_256color_chart.svg
# a gradient from green to yellow to red
color256_range
=
\
[
22
,
28
,
34
,
40
,
46
,
82
,
118
,
154
,
190
,
226
,
220
,
214
,
208
,
202
,
196
]
...
...
@@ -106,13 +106,17 @@ def progress_color(p_todo):
else:
return 0
color_range = color256_range if config().colors() == 256 else color16_range
use_256_colors = config().colors() == 256
color_range = color256_range if use_256_colors else color16_range
progress = get_progress(p_todo)
# TODO: remove linear scale to exponential scale
if progress > 1:
# overdue, return the last color
return Color(color_range[-1])
elif p_todo.is_completed():
# return grey
return Color(243) if use_256_colors else Color(7)
else:
# not overdue, calculate position over color range excl. due date
# color
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment