Skip to content

Commit ed31593

Browse files
committed
Fix color parsing
1 parent e31d634 commit ed31593

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

pytiled_parser/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ def parse_color(color: str) -> Color:
2020
return Color(int(color[0:2], 16), int(color[2:4], 16), int(color[4:6], 16), 255)
2121
elif len(color) == 8:
2222
return Color(
23-
int(color[0:2], 16),
2423
int(color[2:4], 16),
2524
int(color[4:6], 16),
2625
int(color[6:8], 16),
26+
int(color[0:2], 16),
2727
)
2828

2929
raise ValueError("Improperly formatted color passed to parse_color")

tests/test_data/map_tests/external_tileset_dif_dir/expected.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
},
174174
properties={
175175
"bool property - true": True,
176-
"color property": common_types.Color(255, 73, 252, 255),
176+
"color property": common_types.Color(73, 252, 255, 255),
177177
"file property": Path("../../../../../../var/log/syslog"),
178178
"float property": 1.23456789,
179179
"int property": 13,

tests/test_data/map_tests/no_layers/expected.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
properties={
3737
"bool property - true": True,
38-
"color property": common_types.Color(255, 73, 252, 255),
38+
"color property": common_types.Color(73, 252, 255, 255),
3939
"file property": Path("../../../../../../var/log/syslog"),
4040
"float property": 1.23456789,
4141
"int property": 13,

tests/test_data/map_tests/template/expected.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
},
6969
properties={
7070
"bool property - true": True,
71-
"color property": common_types.Color(255, 73, 252, 255),
71+
"color property": common_types.Color(73, 252, 255, 255),
7272
"file property": Path("../../../../../../var/log/syslog"),
7373
"float property": 1.23456789,
7474
"int property": 13,

tests/test_data/tilesets/image_properties/expected.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
version="1.6",
1919
properties={
2020
"bool property": True,
21-
"color property": Color(255, 0, 0, 255),
21+
"color property": Color(0, 0, 255, 255),
2222
"float property": 5.6,
2323
"int property": 5,
2424
"string property": "testing",

tests/test_tiled_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@
261261
coordinates=common_types.OrderedPair(39.0678640445606, 131.826759122428),
262262
properties={
263263
"bool property": False,
264-
"color property": common_types.Color(255, 170, 0, 0),
264+
"color property": common_types.Color(170, 0, 0, 255),
265265
"file property": Path("../../../../../../dev/null"),
266266
"float property": 42.1,
267267
"int property": 8675309,

0 commit comments

Comments
 (0)