Bitmap/Python: Difference between revisions
m
Fixed syntax highlighting.
(→Alternative version: since the default background is white, it makes sense to make the default paint color black (this is also required by Bitmap/Bresenham's_line_algorithm#Python)) |
m (Fixed syntax highlighting.) |
||
Line 4:
{{works with|python|2.4}}
<
class c_color(object):
Line 65:
result = self.pixels[y][x]
assert type(result) is c_color
return result</
===Alternative version===
Line 71:
This makes use of named tuples and may well work with Python 2.6+ too.
<
from copy import copy
Line 139:
+--------------------+
'''</
|