Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Releases: jshwi/object-colors

v2.3.1

24 Sep 01:36
v2.3.1
f25a16e
Compare
Choose a tag to compare

Fixed

  • add default NoneType to __setattr__

v2.3.0

24 Sep 01:10
v2.3.0
16c431f
Compare
Choose a tag to compare

Added

  • Add __all__

Changed

  • update param passed to Color.print
  • update param passed to Color.get

v2.2.0

04 Jan 08:44
v2.2.0
ecc10ef
Compare
Choose a tag to compare

Added

  • Add py.typed

v2.1.0

11 May 06:30
v2.1.0
208f58a
Compare
Choose a tag to compare

Added

  • Allows any object for print

v2.0.1

27 Jul 05:25
v2.0.1
6462020
Compare
Choose a tag to compare

Security

  • Bump urllib3 from 1.26.3 to 1.26.5

v2.0.0

15 Mar 04:11
v2.0.0
0ff23ce
Compare
Choose a tag to compare

Added

  • Adds colorama for Windows systems
  • Overrides __repr__
  • Adds string formatter to get
  • Adds populate for all elements
  • Raises TypeError if setting invalid attribute name
  • Raises IndexError if setting of range int attributes
  • Raises TypeError if setting invalid attribute type
  • Raises ValueError if setting invalid attribute str value
  • Overrides __len__
  • Allows empty get or print without raising an IndexError

Changed

  • Renames: text -> fore, background -> back
  • Renames: purple -> magenta
  • Moves: _get_processed -> __setattr__
  • Improves compiled ANSI string and default types

Deprecated

  • populate_colors is deprecated in favour of populate("fore")

Removed

  • Removes multicolor feature
  • Removes pop method
  • Removes functionality to pass single {1,2,3} digit number as {1,2,3} arg(s)

Fixed

  • Fixes print method to mirror builtin
  • Removes default black background for none
  • Adds all effects
  • Objects can be properly added with __setattr__

Multicolor

03 Feb 05:33
39ed471
Compare
Choose a tag to compare

New Methods

  • multicolor():
    • All colors present in class with randomly color string
  • set_str():
    • Set a new subclass with an ansi escaped string
  • get_object():
    • separate an ansi escaped string into an object containing ansi code and bare string
  • get_list():
    • separate an ansi escaped string into a list containing ansi code and bare string

Add keyword colours

31 Jan 13:14
4b1a492
Compare
Choose a tag to compare

Return string coloured by chosen keywords
The colour of the class will be the colour of the keyword while the rest of the string will remain as it was
Includes option to scatter the search (instead of only words) and option to ignore cases

color = Color(populate=True)
str_ = "String of substrings to colour"
colored_keys = color.red.get_key(str_, "String", scatter=False, ignore_case=False)

These few lines of code would be returned with the substring "String" highlighted in red

Add populate arg

07 Dec 08:14
96bb243
Compare
Choose a tag to compare

Colors("colors") is not intuitive
Colors(populate=True) will populate all colors into class now

Add populate colors

10 Nov 11:23
1f46a04
Compare
Choose a tag to compare

When called with the "colors" string argument the new instance will be populated with an instance for every color.
When combined with the bold object this further simplifies the use of this module.
example:
c = Color("colors")
c.red.print("not bold")
c.red.bold.print("bold")
c.yellow.print("not bold")
c.yellow.bold.print("bold")
etc...