Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [1.5.1] - 2021-07-09

This release contains two bugfixes:

- 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
- 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.

## [1.5.0] - 2021-05-16

This release contains several new features. As of this release pytiled-parser supports 100% of Tiled's feature-set as of Tiled 1.6.
Expand Down
2 changes: 1 addition & 1 deletion pytiled_parser/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ def parse_color(color: str) -> Color:
return Color(int(color[0:2], 16), int(color[2:4], 16), int(color[4:6], 16), 255)
elif len(color) == 8:
return Color(
int(color[0:2], 16),
int(color[2:4], 16),
int(color[4:6], 16),
int(color[6:8], 16),
int(color[0:2], 16),
)

raise ValueError("Improperly formatted color passed to parse_color")
2 changes: 1 addition & 1 deletion pytiled_parser/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""pytiled_parser version"""

__version__ = "1.5.0"
__version__ = "1.5.1"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ setup_requires =
setuptools >= 40.6
pip >= 10
install_requires =
attrs
attrs >= 18.2.0
typing-extensions

[options.packages.find]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
},
properties={
"bool property - true": True,
"color property": common_types.Color(255, 73, 252, 255),
"color property": common_types.Color(73, 252, 255, 255),
"file property": Path("../../../../../../var/log/syslog"),
"float property": 1.23456789,
"int property": 13,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data/map_tests/no_layers/expected.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
properties={
"bool property - true": True,
"color property": common_types.Color(255, 73, 252, 255),
"color property": common_types.Color(73, 252, 255, 255),
"file property": Path("../../../../../../var/log/syslog"),
"float property": 1.23456789,
"int property": 13,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data/map_tests/template/expected.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
},
properties={
"bool property - true": True,
"color property": common_types.Color(255, 73, 252, 255),
"color property": common_types.Color(73, 252, 255, 255),
"file property": Path("../../../../../../var/log/syslog"),
"float property": 1.23456789,
"int property": 13,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data/tilesets/image_properties/expected.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
version="1.6",
properties={
"bool property": True,
"color property": Color(255, 0, 0, 255),
"color property": Color(0, 0, 255, 255),
"float property": 5.6,
"int property": 5,
"string property": "testing",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tiled_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
coordinates=common_types.OrderedPair(39.0678640445606, 131.826759122428),
properties={
"bool property": False,
"color property": common_types.Color(255, 170, 0, 0),
"color property": common_types.Color(170, 0, 0, 255),
"file property": Path("../../../../../../dev/null"),
"float property": 42.1,
"int property": 8675309,
Expand Down