Th3M4ttman / ezcolors

Easy colours in python
MIT License
0 stars 0 forks source link

Advantages of ezcolors over the de facto color library? #1

Open scott91e1 opened 2 years ago

scott91e1 commented 2 years ago

Hello,

I am in the market for a python color manipulation library for a new project. Any chance of a paragraph or two of why ezcolors was created and how it compares to the other libraries out there?

Many thanks,

Scott.

Th3M4ttman commented 2 years ago

Sure thing. EzColors was created when I was trying to find a multi platform terminal colour solution that was easy to use but capable of a wide array of different colour functionalities like gradients, rainbows and various generateable colour palettes and I couldn't find anything that quite fit the bill of what I was looking for.

So I started work on a few functions and classes to make ANSI escape coloured strings in the form of an ordinary str or a ColorStr class with various methods to fiddle with the colours etc I got it to where it was usable for making coloured text relatively easily with nothing but ColorStr("text", "foreground colour in RGB, integer or hex", "background colour") and sort of left it for a while but then later returned and added some extra functionality like simple coloured splash screens and separators and a coloured yes/no/whatever option you want prompt. And colored exceptions for easier reading

The whole thing is somewhat of a mess and in need of cleanup but I use it in many of my projects and for quick prototyping. Overall though I'm not sure I'd recommend it other some alternatives I haven't really looked for too long for exactly what I needed.

If you wanna take a look and suggest any improvements I'd be happy to hear. There's a whole suite of eztools I've got in the works EzFiles (contains a file class for much easier file manipulation) EzConfig (fully featured configs from 1 line) EzPack (dynamically generate, package and build python scripts, modules and packages) EzColors Ezcmd (decorator based system to very easily turn any script into a command line utility and a class to easily create a command prompt from a list of functions) EzTest (easy decorator based unit tests with coloured output and reports with a Test class and a Case class that can be extended easily to automatically generate and cache testcases) EzValid (a bunch of regedit powered varlidators)

With all being available either separately or as 1 package called eztools with additional utilities such as 1 line simple input function output tkinter GUI, and Timers

Sorry to just dump a huge wall of text. In short I'm an intermediate-advanced solo python dev I wouldn't use my EzColors for anything super important but please do mess about with it and see how you like it. I will update the documentation soon as some stuff has probably slightly changed since I did it

Th3M4ttman commented 2 years ago

Also to note I was high both when I wrote EzColors and when I wrote this comment. And both my comments and the entirety of EzColors development were written on a Samsung galaxy a6. So when I say it's multi platform it works everywhere. Mac, windows, Linux, Android

Th3M4ttman commented 2 years ago

Also only just realised how long ago you commented this haha. Sorry for such a slow reply