-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pickle support for enaml's Color (#316)
* Add pickle support for enaml's Color * Use 0xFF for bitmask * Update changelog
- Loading branch information
1 parent
cbfa82b
commit 1b8a06f
Showing
3 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import pickle | ||
|
||
def test_color_pickle(): | ||
from enaml.colors import Color | ||
rgba = 1, 2, 3, 4 | ||
c = Color(*rgba) | ||
print(c.__reduce__()) | ||
blob = pickle.dumps(c) | ||
c = pickle.loads(blob) | ||
assert (c.red, c.green, c.blue, c.alpha) == rgba |