documented colortest

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2009-07-24 00:30:11 -04:00
parent 4f7471005b
commit 6fdad551d4
1 changed files with 5 additions and 17 deletions

View File

@ -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