1 Jun 2006 16:02
r4585 - trunk/sandbox/cliechti/aafigure/aafigure.py
<cliechti <at> users.berlios.de>
2006-06-01 14:02:45 GMT
2006-06-01 14:02:45 GMT
Author: cliechti
Date: 2006-06-01 16:02:33 +0200 (Thu, 01 Jun 2006)
New Revision: 4585
Modified:
trunk/sandbox/cliechti/aafigure/aafigure.py
Log:
add standalone mode (convert one aafigure per text file to an image) not related to docutils
Modified: trunk/sandbox/cliechti/aafigure/aafigure.py
===================================================================
--- trunk/sandbox/cliechti/aafigure/aafigure.py 2006-05-31 14:44:10 UTC (rev 4584)
+++ trunk/sandbox/cliechti/aafigure/aafigure.py 2006-06-01 14:02:33 UTC (rev 4585)
<at> <at> -792,36 +792,113 <at> <at>
if __name__ == '__main__':
import pprint
import svg
+ import pil
import aa
+ import optparse
- def render(text):
- """helper function for tests. scan the given image and create svg output"""
- aaimg = AsciiArtImage(text)
- print text
+ def decode_color(color_string):
+ if color_string[0] == '#': #HTML like color syntax
+ if len(color_string) == 4: # #rgb format
+ r,g,b = [int(c+c, 16) for c in color_string[1:]]
+ elif len(color_string) == 7: # #rrggbb format
(Continue reading)
RSS Feed