Skip to content

Commit

Permalink
Use a better pattern for show-colors
Browse files Browse the repository at this point in the history
  • Loading branch information
jwcxz committed Jun 16, 2013
1 parent 612a579 commit 23a1999
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions show-colors
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CLEAR = "%s%d%s" %( ESC_O, 0, ESC_C );
FG = "3";
BG = "4";
NORMAL = "22";
BOLD = "2";
BOLD = "1";

def cnum(c):
if c in COLORS:
Expand Down Expand Up @@ -40,11 +40,10 @@ def mkcolor(fg, bg, attr=""):
# display a grid of all possible combinations, with both bold and regular
if __name__ == "__main__":
outstr = CLEAR;
for bg in COLORS:
for fg in COLORS:
t = [ mkcolor(fg, bg, NORMAL), " # ",
CLEAR, " ",
mkcolor(fg, bg, BOLD), " # ",
for fg in COLORS:
for bg in COLORS:
t = [ mkcolor(fg, bg, NORMAL), " .:#",
mkcolor(fg, bg, BOLD), "#:. ",
CLEAR, " " ];

outstr += "".join(t);
Expand Down

0 comments on commit 23a1999

Please sign in to comment.