From 6fdad551d4b847ec6c2e231e1df4998ddf4b0462 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Fri, 24 Jul 2009 00:30:11 -0400 Subject: [PATCH] documented colortest --HG-- branch : pmacs2 --- mode/colortest.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/mode/colortest.py b/mode/colortest.py index 6027d65..73232be 100644 --- a/mode/colortest.py +++ b/mode/colortest.py @@ -2,6 +2,10 @@ import color from mode import Fundamental from lex import Grammar, PatternRule +# this mode is kind of fake--it creates and loads a whole bunch of fake token +# classes that are used to populate the view-token-colors command with useful +# versions of the 256 colors (e.g. red-401, magenta-503, etc). + class ColortestGrammar(Grammar): rules = [] for i in range(0, 256): @@ -13,25 +17,9 @@ class Colortest(Fundamental): grammar = ColortestGrammar colors = {} -def abc(name, r, g, b): +for name, r, g, b in color.iter256(): name2 = name + str(r) + str(g) + str(b) ColortestGrammar.rules.append(PatternRule('z-' + name2, name2)) Colortest.colors['z-' + name2] = (name2, 'default') -for name, r, g, b in color.iter256(): - abc(name, r, g, b) - -#for i in range(1, 6): -# for j in range(0, i): -# for k in range(0, i): -# abc('red', i, j, k) -# abc('green', j, i, k) -# abc('blue', j, k, i) -# -#for i in range(1, 6): -# for j in range(0, i): -# abc('yellow', i, i, j) -# abc('cyan', j, i, i) -# abc('magenta', i, j, i) - install = Colortest.install