Changed colors to NCS style.

- See https://en.wikipedia.org/wiki/Natural_Color_System.
This commit is contained in:
Andrew Hamilton 2018-06-16 15:15:21 +10:00
parent 7d6d9d88eb
commit 4c58d377e2
7 changed files with 35 additions and 37 deletions

View file

@ -27,14 +27,14 @@
│ │ │ │
│Statuses: │ │Statuses: │
(B (B Normal │ (B (B Normal │
(B (B Ok │ (B (B Ok │
(B (B Problem │ (B (B Problem │
(B (B Not applicable │ (B (B Not applicable │
(B (B Running │ (B (B Running │
(B (B Paused │ (B (B Paused │
(B (B Timed out │ (B (B Timed out │
│ . Pending │ │ . Pending │
(BE(B Error │ (BE(B Error │
│ │ │ │
│ │ │ │
│ │ │ │
@ -57,4 +57,4 @@
│ │ │ │
│ │ │ │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘ └──────────────────────────────────────────────────────────────────────────────────────────────────┘
(B (Bh(Belp (Bq(Buit (Btab(B:focus (Bt(Burn (Bl(Bog (Be(Bdit (Bn(Bext (Bp(Bause (Bo(Brder (Br(Befresh (Bf(Bullscreen (Brunning(B order:directory (B (B (Bh(Belp (Bq(Buit (Btab(B:focus (Bt(Burn (Bl(Bog (Be(Bdit (Bn(Bext (Bp(Bause (Bo(Brder (Br(Befresh (Bf(Bullscreen (Brunning(B order:directory (B

View file

@ -1,18 +1,18 @@
(Bsize:(B 12.0 B(B (12 bytes)(B (Bsize:(B 12.0 B(B (12 bytes)(B
(Bpermissions:(B ?rwxr-xr-x(B (755)(B (Bpermissions:(B ?rwxr-xr-x(B (755)(B
(Bmodified time:(B Sun Jan 31 23:14:05 2016(B (1454282045 secs)(B (Bmodified time:(B Sun Jan 31 23:14:05 2016(B (1454282045 secs)(B
(Bcreation time:(B Sun Jan 31 23:14:05 2016(B (1454282045 secs)(B (Bcreation time:(B Sun Jan 31 23:14:05 2016(B (1454282045 secs)(B
(Baccess time:(B Sun Jan 31 23:14:07 2016(B (1454282047 secs)(B (Baccess time:(B Sun Jan 31 23:14:07 2016(B (1454282047 secs)(B
(Bowner:(B foo(B (1111 uid)(B (Bowner:(B foo(B (1111 uid)(B
(Bgroup:(B foo(B (1111 gid)(B (Bgroup:(B foo(B (1111 gid)(B
(Bhardlinks:(B 2 (Bhardlinks:(B 2
(Bsymlink:(B no (Bsymlink:(B no
(Bmd5:(B 28ca2e417cb64ea4e555efe3203642de (Bmd5:(B 28ca2e417cb64ea4e555efe3203642de
(Bsha1:(B 8b8c0214f3f0a0d79032d1b44550064964a33a26 (Bsha1:(B 8b8c0214f3f0a0d79032d1b44550064964a33a26
(Bmime type:(B text/x-python; charset=us-ascii (Bmime type:(B text/x-python; charset=us-ascii
(Bfile type:(B Python script, ASCII text executable (B (Bfile type:(B Python script, ASCII text executable (B

View file

@ -1,4 +1,4 @@
(B (B
(B> def hi():(B (B> def hi():(B
(B> print("hi")(B (B> print("hi")(B

View file

@ -1,4 +1,4 @@
(B (B
(B> def hi():(B (B> def hi():(B
(B> print "hi"(B (B> print "hi"(B

View file

@ -196,7 +196,7 @@ def log_filesystem_changed(log, added, removed, modified):
termstr.Color.grey_100 if stat == 0 else color) termstr.Color.grey_100 if stat == 0 else color)
parts = [part(added, "added", termstr.Color.green), parts = [part(added, "added", termstr.Color.green),
part(removed, "removed", termstr.Color.red), part(removed, "removed", termstr.Color.red),
part(modified, "modified", termstr.Color.light_blue)] part(modified, "modified", termstr.Color.blue)]
log.log_message("Filesystem changed: " + fill3.join(" ", parts)) log.log_message("Filesystem changed: " + fill3.join(" ", parts))
@ -892,8 +892,8 @@ class Screen:
progress_bar_size): progress_bar_size):
ordering_text = "directory" if is_directory_sort else "type " ordering_text = "directory" if is_directory_sort else "type "
paused_indicator = (termstr.TermStr("paused ").fg_color( paused_indicator = (termstr.TermStr("paused ").fg_color(
termstr.Color.dark_yellow) if is_paused else termstr.TermStr("running"). termstr.Color.yellow) if is_paused else termstr.TermStr("running").
fg_color(termstr.Color.light_blue)) fg_color(termstr.Color.blue))
indicators = " " + paused_indicator + f" order:{ordering_text} " indicators = " " + paused_indicator + f" order:{ordering_text} "
spacing = " " * (width - len(self._STATUS_BAR) - len(indicators)) spacing = " " * (width - len(self._STATUS_BAR) - len(indicators))
bar = (self._STATUS_BAR[:width - len(indicators)] + spacing + bar = (self._STATUS_BAR[:width - len(indicators)] + spacing +

View file

@ -35,20 +35,18 @@ def _cache_first_result(user_function):
class Color: class Color:
# https://en.wikipedia.org/wiki/Natural_Color_System
black = (0, 0, 0) black = (0, 0, 0)
white = (255, 255, 255) white = (255, 255, 255)
red = (255, 0, 0) red = (196, 2, 51)
green = (0, 128, 0) green = (0, 159, 107)
blue = (0, 0, 255) blue = (0, 135, 189)
dark_red = (139, 0, 0)
lime = (0, 255, 0) lime = (0, 255, 0)
yellow = (255, 255, 0) yellow = (255, 211, 0)
dark_yellow = (255, 211, 0)
# dark_yellow = (204, 204, 0)
grey_50 = (50, 50, 50) grey_50 = (50, 50, 50)
grey_100 = (100, 100, 100) grey_100 = (100, 100, 100)
grey_150 = (150, 150, 150) grey_150 = (150, 150, 150)
light_blue = (90, 90, 255) light_blue = (173, 216, 230)
purple = (200, 0, 200) purple = (200, 0, 200)
brown = (150, 75, 0) brown = (150, 75, 0)
orange = (255, 153, 0) orange = (255, 153, 0)

View file

@ -54,11 +54,11 @@ class Status(enum.IntEnum):
_STATUS_COLORS = {Status.ok: termstr.Color.green, _STATUS_COLORS = {Status.ok: termstr.Color.green,
Status.problem: termstr.Color.dark_red, Status.problem: termstr.Color.red,
Status.normal: termstr.Color.grey_150, Status.normal: termstr.Color.grey_150,
Status.not_applicable: termstr.Color.grey_100, Status.not_applicable: termstr.Color.grey_100,
Status.running: termstr.Color.light_blue, Status.running: termstr.Color.blue,
Status.paused: termstr.Color.dark_yellow, Status.paused: termstr.Color.yellow,
Status.timed_out: termstr.Color.purple} Status.timed_out: termstr.Color.purple}
STATUS_MEANINGS = [ STATUS_MEANINGS = [
(Status.normal, "Normal"), (Status.ok, "Ok"), (Status.normal, "Normal"), (Status.ok, "Ok"),
@ -250,7 +250,7 @@ def metadata(path):
else: else:
name, value = line name, value = line
name = termstr.TermStr(name + ":").fg_color( name = termstr.TermStr(name + ":").fg_color(
termstr.Color.light_blue).ljust(16) termstr.Color.blue).ljust(16)
text.append(name + fill3.join("", value) + "\n") text.append(name + fill3.join("", value) + "\n")
return (Status.normal, fill3.Text(fill3.join("", text))) return (Status.normal, fill3.Text(fill3.join("", text)))