-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add `load` and `decode` functions to mirror the existing `save` and `encode` functions - Convert `Image` class from a type alias into a wrapper around a Pillow image to provide additional functionality. - Make `fill` and `colorramp` functions produce RGBA images to make image composition easier.
- Loading branch information
Showing
14 changed files
with
509 additions
and
216 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import PIL.ImageColor as Color | ||
|
||
|
||
def getcolor(color): | ||
def getcolor(*args, **kwargs): | ||
"""Exactly as Pillow's getrgb function.""" | ||
|
||
return Color.getrgb(color) | ||
return Color.getcolor(*args, **kwargs) | ||
|
||
|
||
def getcolorf(color): | ||
def getcolorf(*args, **kwargs): | ||
"""Exactly as Pillow's getrgb function, but the values are returned as floats.""" | ||
|
||
r, g, b = Color.getrgb(color) | ||
return tuple([r / 255, g / 255, b / 255]) | ||
col = Color.getcolor(*args, **kwargs) | ||
return tuple([c / 255 for c in col]) |
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
Oops, something went wrong.