''' Created on Dec 31, 2014 @author: Brett Paufler Copyright Brett Paufler #CCCCCC, rgb(90,90,90)
 Test Test Test Test
''' import base from jinja2 import Template test = """
 Test Test Test Test
""" #ONE ONE #TWO ABOVE NOT USED YET #TWO ABOVE NOT USED YET color_text = '{{r}}{{g}}{{b}}' def full_color_tables(main_color="red"): text = "" for r in range(1,16,2): text += '\n\n\n' rR = str(hex(15-r)).upper()[-1]*2 r = str(hex(r)).upper()[-1]*2 for g in range(1,16,2): text += "\n" gG = str(hex(15-g)).upper()[-1]*2 g = str(hex(g)).upper()[-1]*2 for b in range(1,16,2): bB = str(hex(15-b)).upper()[-1]*2 b = str(hex(b)).upper()[-1]*2 if main_color == "blue": cD = {'b':r,'g':g,'r':b,'bB':rR,'gG':gG,'rR':bB} elif main_color == "green": cD = {'g':r,'r':g,'b':b,'gG':rR,'rR':gG,'bB':bB} else: cD = {'r':r,'g':g,'b':b,'rR':rR,'gG':gG,'bB':bB} text += Template(color_text).render(cD) + "\n" text += "\n\n" text += "\n
\n" print r,g,b return text solid_color_text = """ {{x}}{{x}}{{x}}
rgb({{dX}},{{dX}},{{dX}})
{{x}}0000
rgb({{dX}},0,0)
00{{x}}00
rgb(0,{{dX}},0)
0000{{x}}
rgb(0,0,{{dX}})
""" def solid_color_table(): text = "\n\n\n" for x in range(16): dX = str(x * 17) y = str(hex(15-x)).upper()[-1]*2 x = str(hex(x)).upper()[-1]*2 #print x, y #print x text += Template(solid_color_text).render(x=x, y=y, dX=dX) text += "
" return text striped_color_text = """ """ def striped_color_table(): text = "\n\n\n" for x in range(16): x = str(hex(x)).upper()[-1] for y in range(16): y = str(hex(y)).upper()[-1] text += Template(striped_color_text).render(x=x,y=y) text += "
" return text if __name__ == '__main__': title = "HTML Color Chart" style = "\ntr, table{width:100%;}\n" style += "td{width:25%;\ntext-align:center;vertical-align:middle;}\n" head_dictionary = {'head_first':'', 'title': title, 'script': "", 'style':style, 'head_last':'', } header_text = "A Quick Reference for RGB Colors

www.Paufler.net\n

' #footer_text += "What use I'd have for the full 16,777,216 offered in " #footer_text += "designing a basic webpage is beyond me.\n

" main_text = "
\n\n

## Red, Green, Blue

\n\n" main_text += solid_color_table() main_text += "

## Spectrum

\nRed Basis
Colors groupings change when red is incremented.

\n\n" main_text += full_color_tables("red") main_text += "

## Spectrum

\nGreen Basis
Same colors different groupings

\n\n" main_text += full_color_tables("green") main_text += "

## Spectrum

\nBlue Basis
Colors shift on blue.

\n\n" main_text += full_color_tables("blue") main_text += "

## Color Stripes

\nBecause, why not?

\n\n" main_text += striped_color_table() main_text += "\n\n