Releases: BhavyeMathur/goopylib
2.1.0
What's Changed
This change marks finally merging the previously 2 distinct goopylib repositories into one. All the history of goopylib v1 has been stacked with v2.
Major changes
- Migrated the C++ Extension to Pybind11 by @BhavyeMathur in #3
- Renamed Renderable
ZPositionmethods toz CameraFrame&CameraFrameSizeare now classes in the Python API
New Features
Minor changes
- Renderable
draw()method now returns a reference to the Renderable - Added virtual destructor for Renderable
- Marked Renderable
getTransparency()methods asconst
Fixes
1.1.318a25
-
Fixed bug with the
Rectangleclass'scopy()function not creating a copy of the position lists and just creating a
new reference -
Fixed bug with the
Colourclass's__eq__()and__nq__()functions raising anAttributeErrorwhen comparing
against a non-Colourobject -
Fixed the
hex_to_rgb()and_hex_to_rgb()functions to return a tuple, not generator -
Fixed bug with the
hex_to_hsl()andhex_to_hsv()functions both returning CMYK values -
Created new colour converter testing functions
-
Changed
Window__repr__()function to use"Window"and not"GraphWin" -
Renamed the
Windowis_resizable(),is_width_resizable(), andis_height_resizable()to usegetinstead -
The
Windowget_resizable()function now returns atuplenot alist -
Removed the
Window__str__()function since__repr__()defined the same thing -
Added
Windowgetter function testing functions -
Fixed bugs with all the CMYK colour conversion functions
-
Changed the
GraphicsErrorin theWindow's__check_open()function to include the string"GraphicsError"at the
start and returnTrueif the window is open -
Added
_check__check_open()and_check__autoflush()methods to theWindowclass to check the functionality of
private methods -
Removed the
Windowstart_move()andstop_move()methods until I can figure out what they do -
Removed the
Windowdraw_bounds()function because it wasn't required. -
Fixed the
Windowget_pos(),get_x_pos(), andget_y_pos()functions to return the value relative to 0, 0 -
Replaced all instances of the deprecated
Pointclass usages with lists inWindow.py -
The
Windowset_background()method no longer uses styles -
Changed
Windowget_bk_colour()method toget_background()to be consistent with the setter -
Windowbackground colours can not be inputted as hex strings -
Removed all auto-flush checks in the
Windowmethods because its private method__autoflush()also does that -
Renamed the variable
RELIEFtoBORDER_RELIEFS -
The
Windowset_icon()method now accepts icons in the local folder too -
Added 3 getter methods to the
Windowclass:get_draggable(),get_x_draggable_x(),get_y_draggable() -
Added 5 getter methods to the
Windowclass:get_top_right(),get_top_left(),get_bottom_right(),
get_bottom_left(), andget_center() -
Fixed bug with the
GraphicsObjectget animation time left functions raising aTypeError -
Fixed error with the
Textclone()method trying to clone aNonetype bounds object -
Added 5 getter methods to the
_BBoxclasses:get_top_right(),get_top_left(),get_bottom_right(),
get_bottom_left(),get_left(),get_right(),get_bottom(),get_top() -
Fixed the colour definition of
DARKISH_TURQUOISEfrom a purple colour to a turquoise colour -
Internally changed how the button
Buttonclass keeps a track of its current state (normal, hover, or clicked) -
Redefined the
_update_lasttimevariable which was removed for an unknown reason -
Renamed the base colour conversion functions, like
_rgb_to_hex()torgb_to_hex_nocheck() -
Added a
__version__variable that keeps track of the goopyplib version, and an__all__variable -
Added American (spelled with color) colour conversion tests to
goopylib_tests.py -
Renamed the goopylib
mathsubpackage tomathsto avoid conflicts with Python's standard library -
Removed
'x_cursor'fromCURSORSand moved it toCURSORS_WINDOWSsince it isn't available on MacOS
1.1.282a14
-
Fixed bug with the
Linerequiring a typelistfor dashes, nottuple -
Fixed bug with the
Lineclass ensuring that the integers for custom dashes are less than266, not256 -
The
Line,Polygon, andRectangleclass now create a copy of all the points entered -
triangulation.pyno longer uses the deprecated Point class -
Fixed bug with the
__update_lasttimevariable not being defined inutil.py
1.1.277a13
-
Added C implementations of conversion functions to convert between colour formats
-
The default values for colour arguments in the Python Colour classes is now 0 to mimic the behaviour of the C classes
-
Removed print statement from the Window class mistakenly left there for debugging
-
Removed creation of the
a0variable insideCubicInterpolation()since it wasn't needed -
Renamed all the functions inside
interpolations.pyto follow the Python naming convention -
Renamed all the functions inside
curves.pyto follow the Python naming convention -
All the functions inside
curves.pyno longer use thePointclass for creating their curves -
Removed debugging print statement from
GraphicsObject.py -
Fixed error with the
linear_curve()andcosine_curve()functions not working properly -
All interpolation functions now accept points in the form
[x, y] -
Added a
cubic_curve()andhermite_curve()function to interpolate between control points -
Fixed bug with the
CurvedLineclass not drawing its options -
Added an example file for the interpolation curve functions
-
Added DPI awareness scaling for the Windows OS
-
Added functions to enable and disable the DPI awareness:
enable_dpi_awareness()anddisable_dpi_awareness() -
Fixed the
colour_gradient()function because it wasn't working when there were 3 divisions -
Changed the roundness of rounded rectangle to work better than before. The amount of roundness now refers to the
radius of the roundness -
Implemented the
__getitem__()functions for the Colour classes to override indexing -
Added
set_fill(),set_outline_width(), andset_outline()functions to the_BBoxclass -
Added an
is_enabled()andis_disabled()function to theButtonandCycleButton(andCheckbox) classes -
The
CycleButton(andCheckbox) class now defaults to the current graphic if no disabled graphic is present -
The
Textclass now defaults the font colour to the default'font colour'option, not to default'outline' -
Fixed bug with the
Rectangleclone()function throwing an error when the object has no defined bounds -
Fixed bug with the
Polygonclass still using the deprecatedPointclass -
Fixed bug with the
Polygon__init__()not using the fill, outline, and outline width arguments correctly -
Reimplemented the
Polygonset_fill(),set_outline(), andset_outline_width()functions properly -
Fixed bug with the
Lineclass not working with layers -
Implemented the
get_fill(),get_outline(), andget_outline_width()functions for thePolygonclass fixing
other bugs as a result -
Added rotation functions to the
Textclass -
All non-getter
Textclass functions now returnself -
Fixed bug with the
GraphicsObjectclass not checking if an object is draggable properly, led to performance upgrade
on mouse presses
1.1.246a22
-
Implemented all remaining PyNumberMethod methods for the C
Colourclass -
Changed the
Colourclass's__round__()method to round up to 255 when the colour value is greater than 127,
compared to the previous 128 -
Updated the link to the goopylib Colour doc in the
Colourclass's__dir__()function -
Defined the
__dir__(),__round__(),__reversed__(), &__contains__()functions for the CColourclass -
Added a separate
__contains__()method for theColourHex()class -
Fixed the
Colour_richcompare()method of the CColourclass for the==&!=operations -
Renamed the
update_values()method of theColourclasses to__update_values() -
Fixed circular import with importing the
Windowwhile important theGraphicsObjectmodule without importing the
Windowmodule yourself -
Fixed issue with incorrectly named module import in
goopylib.sound.waves.py -
Fixed error with the
Windowclass incorrectly initializing because the root wasn't updating, see
https://stackoverflow.com/questions/34373533/winfo-width-returns-1-even-after-using-pack
1.1.236a21
-
Fixed warning with the
stringattribute of the C implementation of theColourHexclass in which thePyObject*
was being defined to achar[7]. It is now defined to aPyUnicodeobject. -
Changed
abs()tofabs()incolours.cwhen it took afloatargument -
The
hexstringvariable in thergb_to_hex()function incolours.cis now static to avoid returning a 'address of
stack memory associated with local variable' -
Renamed all the modules in goopylib.math & all C extensions with the Python naming convention
(lowercase & underscores) -
Fixed bug with the goopylib C extension modules raising errors when being imported
-
Removed the
__get_item__()&__len__()functions of theColourclass as they didn't make a lot of sense to keep -
Simplified expressions to check for valid arguments in
colours.pyand made them run faster by removing unneeded
nots -
Renamed
Sound.pytosound.pyto follow the Python naming convention -
Added argument validation to all functions in
colours.pyto ensure the user has entered the correct types -
Fixed bug with the
Colourclass incorrectly executing the__contains__()function -
Every
Coloursubclass has separate__contains__(),__round__()__,__iter__(), &__copy__()methods -
Changed
max([...])tomax(...)inside thecolour_gradient()&color_gradient()functions to make them faster -
Added another set of colour conversions with a
_prefix, these functions do not validate arguments -
The Colour types in
colours.cnow use aPyObject *to store the hex colour string of a colour instance as opposed
to the previous use of achar[7] -
Fixed error with the C colours module not compiling when
PyNumberMethodsof the Colour type were specified in the
module INIT -
The C
ColourHSV&ColourHSLtypes now take integer arguments for the S & V, and S & L values just like the Python
classes -
Fixed the conversion from HSV to RGB and HSL to RGB in the initialization functions of
ColourHSV&ColoursHSLin
colours.c -
Moved the error checking from the
bezier_curve.pyinterface toc_bezier_curve.cmaking it faster -
The
factorial()function defined inc_bezier_curve.cis no longer accessible from Python
(use standardmath.factorial()instead) -
Defined all unary PyNumberMethods for the C implementation of the
Colourclass as well as nb_add, nb_subtract,
nb_multiply, nb_remainder, nb_divmod, & nb_power. All other PyNumberMethods return an emptyColourclass
1.1.216a20
-
Fixed bug with the
ColourHSL&ColourHSVclasses not correctly converting to RGB values properly when
120 <= h < 180 -
Added a C implementation of the
ColourHSV&ColourHSLclasses tocolours.c -
The Colour type in
colours.cfinally overrides the number protocol (for operations like addition, subtraction, etc.) -
Fixed mispelt argument name
color_start1in thecolor_gradient_2d()function -
Changed the
__init_subclass__()method in theColourclass to just a__init__()method as the previous wasn't
required -
Moved the default instance variable definitions in the
Colourclass outside the__init__()function and to static
variables -
Allowed the C implementation of the
rgb_to_hex()function to be accessible from Python -
Changed the docstrings of the
CBezierCurvemodule functions to show what the output type of each function is -
Added a
hex_digit_to_int()function tocolours.cthat allows you to convert a hexadecimal digit to a base-10 int -
The
Colourtypes implemented in C are now actually semi-usable. -
Removed the
__format__()method from theColourclass because it wasn't required -
Changed the C-implementation of the
Colourtype's__repr__()method to match the Python implementation -
Fixed misordered format values in the
rgb()method of theColourclass -
Reordered the PyNumber Methods of the
Colourclass to follow the order described here:
https://docs.python.org/3/c-api/typeobj.html?highlight=tp_#c.PyNumberMethods -
Changed the
__hex__()method of theColourclass to return aColourHexinstance of the same colour as which the
function is used on -
Made the
Colourclass PyNumber Methods faster by replacing themin([255, ...])for if statements -
Using the multiplication operator on a
Colourinstance will now make sure that the rgb values for the colour are less
than 256 -
You can no longer perform operations with floats and
Colourobjects -
The
pow()function withColourobjects now accepts aColourtype value for the modulo argument -
Colourobject PyNumber Methods now set the red, green, or blue value to 0 if the resulting value from operation is
less than 0 -
Added functions to convert between colour types:
hex_to_rgb(),cmyk_to_rgb(),hsv_to_rgb(),hsl_to_rgb(),
rgb_to_cmyk(),rgb_to_hsl(),rgb_to_hsv(),hex_to_cmyk(),hex_to_hsl(),hex_to_hsv(),cmyk_to_hex(),
cmyk_to_hsl(),cmyk_to_hsv(),hsv_to_hex(),hsv_to_cmyk(),hsv_to_hsl(),hsl_to_hex(),hsl_to_cmyk(), &
hsl_to_hsl() -
Copied the
Colourclass's__floordiv__()function to its__truediv__()one to use"/"in the error message
rather than"//"s -
The
ColourHSL&ColourHSVclasses now only accept integer values representing percentages for H & L, and H & V to
make it consistent withColourCMYK -
Simplified the conversion of inputs to RGB for the
ColourCMYK,ColourHSV, &ColourHSLclasses by removing 3
redundant variables -
Fixed bug with the
Colourclasses not updating their string & hex value when performed operations on. This meant
that operations on colours had no real effect. -
Renamed the colour
ABSOLUTE_TURQUOISEtoABSOLUTE_CYAN -
colours.pynow uses theround()function to round outputs of operations/functions on colours to the nearest
integer rather than the previousint()which sometimes gave errors of +-1 -
Fixed a bug in the
ColourCMYK()class where the CMYK colours were not being properly converted to RGB -
Renamed the
Colourclass'srgb()function torgb_string() -
Added methods to return a
Colourinstance's colours in different colour models:hex_string(),cmyk_string(),
hsv_string(),hsl_string() -
Added methods to the
Colourclass to convert the colour into another colour type:to_rgb_colour(),
to_hex_colour(),to_cmyk_colour(),to_hsl_colour(),to_hsv_colour() -
There are now separate PyNumber methods for each
Coloursubclass (exceptColourRGB) whose return values are the
type the operation is performed on -
All goopylib pre-defined colours use the
ColourRGBclass (some previously usedColourHex) as it is the most
efficientColoursubclass -
Fixed the ordering of
ColourCMYKarguments fromc, y, m, ktoc, m, y, k -
Changed the
__lshift__()&__rshift__()methods of theColourclass to ensure that the returned value is within
permitted bounds for a colour -
Added setter functions for
Coloursubclasses to set individual colour arguments -
Operations on Colours of the same type (RGB & RGB, HSL & HSL, etc.) are now performed argument-wise for that colour,
ie h1 + h2, s1 + s2, v1 + v2 for HSL + HSL rather than converting to RGB first. -
The inplace PyNumber methods of the
Coloursubclasses (except forColourRGB&ColourHex) now follow the same
rules as the normal PyNumber methods
1.1.176a19
-
You can now use the
set_text()function forEntryobjects even if theEntryhasn't been drawn -
Fixed the
RandomColourRGB()function to no longer raise errors if the user hasn't specified the RGB values -
Optimized the error checking in the
RandomColourRGB()&RandomGreyscale()functions by reducing the number of
not&!= -
Simplified the
RandomColourCMYK()function and optimized it like with theRandomColourRGB()one -
The
RandomColourHex()function now works if the user hasn't supplied hex values for r, g, & b and optimized the
function to execute faster -
Added a new lists to contain all of
GREENS,PURPLES, etc. and forWARM COLOURSandCOOL COLOURS -
Added a list of all goopylib colours objects
-
Added HSV colours to goopylib: a
ColourHSVclass &RandomColourHSV()function -
Changed all the
GraphicsErrors incolours.pyto be raised with a"GraphicsError:"prefix -
The
ColourCMYKclass is now printed as"cmyk c%, m%, y%, k%"rather than the previous"cmyk c, m, y, k" -
The Internal goopylib classes no longer use the
Pointclass in favour of an iterable -
Added a few more (7) colour definitions to complete the existing colour scales
-
Added HSL colours to goopylib: a
ColourHSLclass &RandomColourHSL()function -
Renamed all the functions inside
colours.pyto follow the Python naming convention -
Added American spelling (
color) equivalents of everything incolours.pywhich references the original functions -
Renamed the
blend_BLENDINGTYPE()functions toblend_colour_BLENDINGTYPE()and added their American equivalents. -
Moved the
randommodule's import statement above thegoopylib.math.Interpolationsimport statement incolours.py
to abide by PEP8 -
Created a
color.pyfile which simply imports everything fromcolours.py
1.1.158a18
-
The
is_clicked()function of theGraphicsObjectclass returns whether or not the object'sboundswere clicked.
If it has no bounds, it returnsFalse -
Made the
RadioButtonclass an iterable -
You can now use the
len()function onRadioButtonandCycleButtonobjects -
The
RadioButtonandCycleButtonclasses are now subscriptable -
Added an
anchorattribute to theCycleButtonclass to support gliding -
The
RadioButtonandCycleButtonclasses now support movement and gliding functions -
The
get_anchor()function of theCycleButtonclass now returns the value from its states'get_anchor()function,
not theanchorattribute itself -
The
is_clicked()function in theImage()class now uses integer division (//) rather than float division (/)
to make it slightly faster and also pre-calculates the divisions to perform half the division operations -
Fixed bug with the
RadioButton&CycleButtonclass not changing their anchors when moving -
Fixed bug with all the
GraphicsObjectglide functions adding 2 lists together instead of their elements -
The
RadioButtonclass now raises an error if the user has specified 0 states -
Added a
get_anchor()function to theRadioButtonclass -
Fixed bug with
Buttonobjects not defining theiranchorduring the initialization -
The
change_graphic()function of theButtonclass now allows you to set graphics toNone -
The
GraphicObjectclass now raises an error if the user tries to glide an object which does not support it -
Renamed the
allow_only_numeric()function of theEntrytoallow_only_positive_integer()and added 2 new
functions:allow_only_numeric()andallow_only_integer()
1.1.142a17
-
Fixed bug with the default Image Texture path being
textures_other/instead oftextures/ -
Fixed bug with every
GraphicsObjectentering an infinite loop when the user sets the objects' layer to not 0 -
Added
animate_resize()andanimate_resize_factor()functions to theGraphicsObjectclass -
Added a
get_state()function to theRadioButtonclass -
You can now specify custom bounds for a
Checkboxinstance -
Fixed bug with the Text object's
is_clicked()function not working properly when the text is not center-aligned -
Fixed bug with the
GraphicsObjectclass raising an error when you try to destroy an object twice -
Added a
set_state()function to theRadioButtonclass