Skip to content

Releases: BhavyeMathur/goopylib

2.1.0

08 Jun 23:29
Compare
Choose a tag to compare

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

New Features

Minor changes

Fixes

1.1.318a25

25 May 14:30
Compare
Choose a tag to compare
1.1.318a25 Pre-release
Pre-release
  • Fixed bug with the Rectangle class's copy() function not creating a copy of the position lists and just creating a
    new reference

  • Fixed bug with the Colour class's __eq__() and __nq__() functions raising an AttributeError when comparing
    against a non-Colour object

  • Fixed the hex_to_rgb() and _hex_to_rgb() functions to return a tuple, not generator

  • Fixed bug with the hex_to_hsl() and hex_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 Window is_resizable(), is_width_resizable(), and is_height_resizable() to use get instead

  • The Window get_resizable() function now returns a tuple not a list

  • Removed the Window __str__() function since __repr__() defined the same thing

  • Added Window getter function testing functions

  • Fixed bugs with all the CMYK colour conversion functions

  • Changed the GraphicsError in the Window's __check_open() function to include the string "GraphicsError" at the
    start and return True if the window is open

  • Added _check__check_open() and _check__autoflush() methods to the Window class to check the functionality of
    private methods

  • Removed the Window start_move() and stop_move() methods until I can figure out what they do

  • Removed the Window draw_bounds() function because it wasn't required.

  • Fixed the Window get_pos(), get_x_pos(), and get_y_pos() functions to return the value relative to 0, 0

  • Replaced all instances of the deprecated Point class usages with lists in Window.py

  • The Window set_background() method no longer uses styles

  • Changed Window get_bk_colour() method to get_background() to be consistent with the setter

  • Window background colours can not be inputted as hex strings

  • Removed all auto-flush checks in the Window methods because its private method __autoflush() also does that

  • Renamed the variable RELIEF to BORDER_RELIEFS

  • The Window set_icon() method now accepts icons in the local folder too

  • Added 3 getter methods to the Window class: get_draggable(), get_x_draggable_x(), get_y_draggable()

  • Added 5 getter methods to the Window class: get_top_right(), get_top_left(), get_bottom_right(),
    get_bottom_left(), and get_center()

  • Fixed bug with the GraphicsObject get animation time left functions raising a TypeError

  • Fixed error with the Text clone() method trying to clone a None type bounds object

  • Added 5 getter methods to the _BBox classes: 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_TURQUOISE from a purple colour to a turquoise colour

  • Internally changed how the button Button class keeps a track of its current state (normal, hover, or clicked)

  • Redefined the _update_lasttime variable which was removed for an unknown reason

  • Renamed the base colour conversion functions, like _rgb_to_hex() to rgb_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 math subpackage to maths to avoid conflicts with Python's standard library

  • Removed 'x_cursor' from CURSORS and moved it to CURSORS_WINDOWS since it isn't available on MacOS

1.1.282a14

07 Apr 06:57
fd7dacc
Compare
Choose a tag to compare
1.1.282a14 Pre-release
Pre-release
  • Fixed bug with the Line requiring a type list for dashes, not tuple

  • Fixed bug with the Line class ensuring that the integers for custom dashes are less than 266, not 256

  • The Line, Polygon, and Rectangle class now create a copy of all the points entered

  • triangulation.py no longer uses the deprecated Point class

  • Fixed bug with the __update_lasttime variable not being defined in util.py

1.1.277a13

07 Apr 06:56
fd7dacc
Compare
Choose a tag to compare
1.1.277a13 Pre-release
Pre-release
  • 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 a0 variable inside CubicInterpolation() since it wasn't needed

  • Renamed all the functions inside interpolations.py to follow the Python naming convention

  • Renamed all the functions inside curves.py to follow the Python naming convention

  • All the functions inside curves.py no longer use the Point class for creating their curves

  • Removed debugging print statement from GraphicsObject.py

  • Fixed error with the linear_curve() and cosine_curve() functions not working properly

  • All interpolation functions now accept points in the form [x, y]

  • Added a cubic_curve() and hermite_curve() function to interpolate between control points

  • Fixed bug with the CurvedLine class 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() and disable_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(), and set_outline() functions to the _BBox class

  • Added an is_enabled() and is_disabled() function to the Button and CycleButton (and Checkbox) classes

  • The CycleButton (and Checkbox) class now defaults to the current graphic if no disabled graphic is present

  • The Text class now defaults the font colour to the default 'font colour' option, not to default 'outline'

  • Fixed bug with the Rectangle clone() function throwing an error when the object has no defined bounds

  • Fixed bug with the Polygon class still using the deprecated Point class

  • Fixed bug with the Polygon __init__() not using the fill, outline, and outline width arguments correctly

  • Reimplemented the Polygon set_fill(), set_outline(), and set_outline_width() functions properly

  • Fixed bug with the Line class not working with layers

  • Implemented the get_fill(), get_outline(), and get_outline_width() functions for the Polygon class fixing
    other bugs as a result

  • Added rotation functions to the Text class

  • All non-getter Text class functions now return self

  • Fixed bug with the GraphicsObject class not checking if an object is draggable properly, led to performance upgrade
    on mouse presses

1.1.246a22

14 Dec 18:43
Compare
Choose a tag to compare
1.1.246a22 Pre-release
Pre-release
  • Implemented all remaining PyNumberMethod methods for the C Colour class

  • Changed the Colour class'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 Colour class's __dir__() function

  • Defined the __dir__(), __round__(), __reversed__(), & __contains__() functions for the C Colour class

  • Added a separate __contains__() method for the ColourHex() class

  • Fixed the Colour_richcompare() method of the C Colour class for the == & != operations

  • Renamed the update_values() method of the Colour classes to __update_values()

  • Fixed circular import with importing the Window while important the GraphicsObject module without importing the
    Window module yourself

  • Fixed issue with incorrectly named module import in goopylib.sound.waves.py

  • Fixed error with the Window class 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

09 Dec 19:36
Compare
Choose a tag to compare
1.1.236a21 Pre-release
Pre-release
  • Fixed warning with the string attribute of the C implementation of the ColourHex class in which the PyObject*
    was being defined to a char[7]. It is now defined to a PyUnicode object.

  • Changed abs() to fabs() in colours.c when it took a float argument

  • The hexstring variable in the rgb_to_hex() function in colours.c is 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 the Colour class as they didn't make a lot of sense to keep

  • Simplified expressions to check for valid arguments in colours.py and made them run faster by removing unneeded
    nots

  • Renamed Sound.py to sound.py to follow the Python naming convention

  • Added argument validation to all functions in colours.py to ensure the user has entered the correct types

  • Fixed bug with the Colour class incorrectly executing the __contains__() function

  • Every Colour subclass has separate __contains__(), __round__()__, __iter__(), & __copy__() methods

  • Changed max([...]) to max(...) inside the colour_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.c now use a PyObject * to store the hex colour string of a colour instance as opposed
    to the previous use of a char[7]

  • Fixed error with the C colours module not compiling when PyNumberMethods of the Colour type were specified in the
    module INIT

  • The C ColourHSV & ColourHSL types 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 & ColoursHSL in
    colours.c

  • Moved the error checking from the bezier_curve.py interface to c_bezier_curve.c making it faster

  • The factorial() function defined in c_bezier_curve.c is no longer accessible from Python
    (use standard math.factorial() instead)

  • Defined all unary PyNumberMethods for the C implementation of the Colour class as well as nb_add, nb_subtract,
    nb_multiply, nb_remainder, nb_divmod, & nb_power. All other PyNumberMethods return an empty Colour class

1.1.216a20

03 Dec 15:54
Compare
Choose a tag to compare
1.1.216a20 Pre-release
Pre-release
  • Fixed bug with the ColourHSL & ColourHSV classes not correctly converting to RGB values properly when
    120 <= h < 180

  • Added a C implementation of the ColourHSV & ColourHSL classes to colours.c

  • The Colour type in colours.c finally overrides the number protocol (for operations like addition, subtraction, etc.)

  • Fixed mispelt argument name color_start1 in the color_gradient_2d() function

  • Changed the __init_subclass__() method in the Colour class to just a __init__() method as the previous wasn't
    required

  • Moved the default instance variable definitions in the Colour class 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 CBezierCurve module functions to show what the output type of each function is

  • Added a hex_digit_to_int() function to colours.c that allows you to convert a hexadecimal digit to a base-10 int

  • The Colour types implemented in C are now actually semi-usable.

  • Removed the __format__() method from the Colour class because it wasn't required

  • Changed the C-implementation of the Colour type's __repr__() method to match the Python implementation

  • Fixed misordered format values in the rgb() method of the Colour class

  • Reordered the PyNumber Methods of the Colour class to follow the order described here:
    https://docs.python.org/3/c-api/typeobj.html?highlight=tp_#c.PyNumberMethods

  • Changed the __hex__() method of the Colour class to return a ColourHex instance of the same colour as which the
    function is used on

  • Made the Colour class PyNumber Methods faster by replacing the min([255, ...]) for if statements

  • Using the multiplication operator on a Colour instance will now make sure that the rgb values for the colour are less
    than 256

  • You can no longer perform operations with floats and Colour objects

  • The pow() function with Colour objects now accepts a Colour type value for the modulo argument

  • Colour object 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 Colour class's __floordiv__() function to its __truediv__() one to use "/" in the error message
    rather than "//"s

  • The ColourHSL & ColourHSV classes now only accept integer values representing percentages for H & L, and H & V to
    make it consistent with ColourCMYK

  • Simplified the conversion of inputs to RGB for the ColourCMYK, ColourHSV, & ColourHSL classes by removing 3
    redundant variables

  • Fixed bug with the Colour classes not updating their string & hex value when performed operations on. This meant
    that operations on colours had no real effect.

  • Renamed the colour ABSOLUTE_TURQUOISE to ABSOLUTE_CYAN

  • colours.py now uses the round() function to round outputs of operations/functions on colours to the nearest
    integer rather than the previous int() 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 Colour class's rgb() function to rgb_string()

  • Added methods to return a Colour instance's colours in different colour models: hex_string(), cmyk_string(),
    hsv_string(), hsl_string()

  • Added methods to the Colour class 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 Colour subclass (except ColourRGB) whose return values are the
    type the operation is performed on

  • All goopylib pre-defined colours use the ColourRGB class (some previously used ColourHex) as it is the most
    efficient Colour subclass

  • Fixed the ordering of ColourCMYK arguments from c, y, m, k to c, m, y, k

  • Changed the __lshift__() & __rshift__() methods of the Colour class to ensure that the returned value is within
    permitted bounds for a colour

  • Added setter functions for Colour subclasses 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 Colour subclasses (except for ColourRGB & ColourHex) now follow the same
    rules as the normal PyNumber methods

1.1.176a19

28 Nov 10:25
Compare
Choose a tag to compare
1.1.176a19 Pre-release
Pre-release
  • You can now use the set_text() function for Entry objects even if the Entry hasn'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 the RandomColourRGB() 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 for WARM COLOURS and COOL COLOURS

  • Added a list of all goopylib colours objects

  • Added HSV colours to goopylib: a ColourHSV class & RandomColourHSV() function

  • Changed all the GraphicsErrors in colours.py to be raised with a "GraphicsError:" prefix

  • The ColourCMYK class 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 Point class in favour of an iterable

  • Added a few more (7) colour definitions to complete the existing colour scales

  • Added HSL colours to goopylib: a ColourHSL class & RandomColourHSL() function

  • Renamed all the functions inside colours.py to follow the Python naming convention

  • Added American spelling (color) equivalents of everything in colours.py which references the original functions

  • Renamed the blend_BLENDINGTYPE() functions to blend_colour_BLENDINGTYPE() and added their American equivalents.

  • Moved the random module's import statement above the goopylib.math.Interpolations import statement in colours.py
    to abide by PEP8

  • Created a color.py file which simply imports everything from colours.py

1.1.158a18

03 Nov 18:23
Compare
Choose a tag to compare
1.1.158a18 Pre-release
Pre-release
  • The is_clicked() function of the GraphicsObject class returns whether or not the object's bounds were clicked.
    If it has no bounds, it returns False

  • Made the RadioButton class an iterable

  • You can now use the len() function on RadioButton and CycleButton objects

  • The RadioButton and CycleButton classes are now subscriptable

  • Added an anchor attribute to the CycleButton class to support gliding

  • The RadioButton and CycleButton classes now support movement and gliding functions

  • The get_anchor() function of the CycleButton class now returns the value from its states' get_anchor() function,
    not the anchor attribute itself

  • The is_clicked() function in the Image() 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 & CycleButton class not changing their anchors when moving

  • Fixed bug with all the GraphicsObjectglide functions adding 2 lists together instead of their elements

  • The RadioButton class now raises an error if the user has specified 0 states

  • Added a get_anchor() function to the RadioButton class

  • Fixed bug with Button objects not defining their anchor during the initialization

  • The change_graphic() function of the Button class now allows you to set graphics to None

  • The GraphicObject class now raises an error if the user tries to glide an object which does not support it

  • Renamed the allow_only_numeric() function of the Entry to allow_only_positive_integer() and added 2 new
    functions: allow_only_numeric() and allow_only_integer()

1.1.142a17

02 Nov 18:21
Compare
Choose a tag to compare
1.1.142a17 Pre-release
Pre-release
  • Fixed bug with the default Image Texture path being textures_other/ instead of textures/

  • Fixed bug with every GraphicsObject entering an infinite loop when the user sets the objects' layer to not 0

  • Added animate_resize() and animate_resize_factor() functions to the GraphicsObject class

  • Added a get_state() function to the RadioButton class

  • You can now specify custom bounds for a Checkbox instance

  • Fixed bug with the Text object's is_clicked() function not working properly when the text is not center-aligned

  • Fixed bug with the GraphicsObject class raising an error when you try to destroy an object twice

  • Added a set_state() function to the RadioButton class