Skip to content

Commit 4215d6c

Browse files
authored
Merge pull request #40 from Beefy-Swain/development
Merge Development for v1.5.1
2 parents 4bdd1d0 + e77f15c commit 4215d6c

File tree

9 files changed

+15
-8
lines changed

9 files changed

+15
-8
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## [1.5.1] - 2021-07-09
10+
11+
This release contains two bugfixes:
12+
13+
- Pinned minimum attrs version to usage of `kw_only` which was introduced in 18.2.0. See https://github.com/Beefy-Swain/pytiled_parser/pull/39
14+
- Fixed color parsing to be correct. Tiled saves it's colors in either RGB or ARGB format. We were previously parsing RGB correctly, but if an alpha value was present it would be parsed if it were RGBA and so all the values would be offset by one.
15+
916
## [1.5.0] - 2021-05-16
1017

1118
This release contains several new features. As of this release pytiled-parser supports 100% of Tiled's feature-set as of Tiled 1.6.

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")

pytiled_parser/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""pytiled_parser version"""
22

3-
__version__ = "1.5.0"
3+
__version__ = "1.5.1"

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ setup_requires =
2828
setuptools >= 40.6
2929
pip >= 10
3030
install_requires =
31-
attrs
31+
attrs >= 18.2.0
3232
typing-extensions
3333

3434
[options.packages.find]

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)