Skip to content

Commit 3440e8c

Browse files
4B796C65@gmail.com4B796C65@gmail.com
authored andcommitted
Minor update
1 parent 372f449 commit 3440e8c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
REVISION = int(''.join(c for c in "$Revision$" if c.isdigit()))
3+
REVISION = int(''.join(c for c in "$Rev$" if c.isdigit()))
44
VERSION = '1.0r%i' % REVISION
55

66
try:

tdl/tcod.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,16 @@ def _get_library_crossplatform():
5454
class _Color(Structure):
5555
_fields_ = [('r', c_uint8), ('g', c_uint8), ('b', c_uint8)]
5656

57-
def __iter__(self): # to make this more tuple-like
57+
def __iter__(self):
58+
'to make this class more tuple-like
5859
return iter((self.r, self.g, self.b))
5960

6061
def __len__(self):
6162
return 3
63+
64+
def __int__(self):
65+
"useful to convert back into web format: 0xRRGGBB"
66+
return (self.r << 16 | self.g << 8 | self.b)
6267

6368
_lib.TCOD_color_equals.restype = c_bool
6469
_lib.TCOD_color_equals.argtypes = (_Color, _Color)

0 commit comments

Comments
 (0)