Saravanan666/pypi-org huggingface dataset:
Package: colorgetter
colorgetterPython color getter (being able to get random/complementary/lighter/darker color, convert between rgb/hex)Setuppython -m pip install python-color-getterMethod Overviewget_random_color() -> tupleget_color_from_stylesheet(code: str) -> Noneget_comp_color(r: int, g: int, b: int) -> tuplergb_to_hex(r: int, g: int, b: int, digit_cnt: int = 6) -> str- Argumentdigit_cntis digit count of hex color user want to get.  The value ofdigit_cntshould be 3 or 6. It is set to 6 by default.hex_to_rgb(hex: str) -> tuple- Argumenthexshould be 3 or 6 digit hex colors like #DDD, #ABABAB.lighter(r: int, g: int, b: int) -> tupledarker(r: int, g: int, b: int) -> tupleExampleCode Sampleprint(get_random_color())print(get_comp_color(255,0,0))print(hex_to_rgb('#2c2c2c'))r,g,b=44,44,44print(rgb_to_hex(r,g,b))light_r,light_g,light_b=lighter(r,g,b)print(rgb_to_hex(light_r,light_g,light_b))dark_r,dark_g,dark_b=darker(r,g,b)print(rgb_to_hex(dark_r,dark_g,dark_b))Result(211, 195, 123)

(0, 255, 255)

(44, 44, 44)

#2c2c2c

#3d3d3d

#1b1b1b
Package: color-gradient-generator
Color Gradient GeneratorThis tool will allow you to generate a color gradient from RGB, decimal or hexadecimal. The source code is available onGitHub.Table of contentColor Gradient GeneratorTable of contentColorsColor formatsErrorsIncorrectProvidedColorGradient generatorColorsEvery color of the gradient has a value, and that is all you see, but in fact, there is a class namedColor, which have a "value" argument.With this class, you can access the color format. The purpose of this class is also to convert its original value to all of the available formats, in case you want your gradient in a specific format.Color formatsThere are 3 color formats, accessible by theColorFormatEnum class:DEC for decimalHEX for hexadecimalRGB for RGBErrorsA lot of time, while you use this generator, error will raise. A lot of them would just beTypeErrorofAttributeError, but custom errors is a thing. At the moment, only one was created.IncorrectProvidedColorThis error raises when the color argument of theColorclass is incorrect.Gradient generatorThe color generation is accessible by thegenerate_gradientfunction. There are 3 kwargs : the two colors and the amont of variations to add in the gradient. Then there are 2 optionnal args : _format, which is the format in which the gradient will generate, and hex_prefix, useful only if you generate an hexadecimal gradient.If the amont of variations provided is too high in relation to the difference between the two colors, an error will raise. You can have up to 500 variations.If you do not provide a "_format" argument, it is necessary that both colors have the same format.If you do not provide a "hex_prefix" argument, there will simply be no prefix.Well then, that's about it, have fun !
Package: colorgram.py
colorgram.pyis a Python library that lets you extract colors from images. Compared to other libraries, the colorgram algorithm’s results are more intense.colorgram.py is a port ofcolorgram.js, a JavaScript library written by GitHub user@darosh. The goal is to have 100% accuracy to the results of the original library (a goal that is met). I decided to port it since I much prefer the results the colorgram algorithm gets over those of alternative libraries - have a look in the next section.ResultsTime-wise, an extraction of a 512x512 image takes about 0.66s (another popular color extraction library,Color Thief, takes about 1.05s).InstallationYou can install colorgram.py withpip, as following:pip install colorgram.pyHow to useUsing colorgram.py is simple. Mainly there’s only one function you’ll need to use -colorgram.extract.Exampleimportcolorgram# Extract 6 colors from an image.colors=colorgram.extract('sweet_pic.jpg',6)# colorgram.extract returns Color objects, which let you access# RGB, HSL, and what proportion of the image was that color.first_color=colors[0]rgb=first_color.rgb# e.g. (255, 151, 210)hsl=first_color.hsl# e.g. (230, 255, 203)proportion=first_color.proportion# e.g. 0.34# RGB and HSL are named tuples, so values can be accessed as properties.# These all work just as well:red=rgb[0]red=rgb.rsaturation=hsl[1]saturation=hsl.scolorgram.extract(image, number_of_colors)Extract colors from an image.imagemay be either a path to a file, a file-like object, or a PillowImageobject. The function will return a list ofnumber_of_colorsColorobjects.colorgram.ColorA color extracted from an image. Its properties are:Color.rgb- The color represented as anamedtupleof RGB from 0 to 255, e.g.(r=255, g=151, b=210).Color.hsl- The color represented as anamedtupleof HSL from 0 to 255, e.g.(h=230, s=255, l=203).Color.proportion- The proportion of the image that is in the extracted color from 0 to 1, e.g.0.34.Sorting by HSLSomething the original library lets you do is sort the colors you get by HSL. In actuality, though, the colors are only sorted by hue (as of colorgram.js 0.1.5), while saturation and lightness are ignored. To get the corresponding result in colorgram.py, simply do:colors.sort(key=lambdac:c.hsl.h)# or...sorted(colors,key=lambdac:c.hsl.h)ContactIf you find a bug in the colorgram.py, or if there’s a feature you would like to be added, pleaseopen an issueon GitHub.If you have a question about the library, or if you’d just like to talk about, well, anything, that’s no problem at all. You can reach me in any of these ways:Tweet@obskyrE-mail meTo get a quick answer, Twitter is your best bet.Enjoy!
Package: colorguard
Color Guardprovides simple bit manipulation and bit flags in Python. Everything is built on
theinttype so no number functionality is lost, while making it possible to index and slice binary numbers
like strings.Basic usage:>>>num=Bits(20)>>>numBits(0b10100)>>>num*3Bits(0b111100)>>>num[:4]Bits(0b1010)>>>num.bit_length()5>>>num.join(0b101)Bits(0b10100101)Color Guard also supports conversion to and from other Python data types.>>>Bits.from_binary("111101001101")Bits(0b111101001101)>>>Bits.from_hex("abc123")Bits(0b101010111100000100100011)>>>Bits.from_bytes(b"abc")Bits(0b11000010110001001100011)>>>bytes(Bits(367))b'\x01o'>>>int(Bits(0b1011010))90>>>list(Bits(367))[1, 0, 1, 1, 0, 1, 1, 1, 1]FeaturesIndexing and slicing of binary numbers like stringsConversion between several Python data typesAll builtin math operations including bit manipulation and comparisonPadded binary numbers that maintain bit lengthCustom, easy-to-use bit flagsBit field loading from bytes or streamCustom data descriptors for fieldsField editing & conversion to bytesFor further documentation, visithttp://paric.xyz/python/
Package: color-harmony
color-harmony.pyA python script that extract main color groups from an image using k-means clustering and returns the color harmony based on the RGB wheelDependenciesPython 3.7+sklearnPillowmatplotlibInstallationPipThe stable releases of gallery-dl are distributed on PyPI and can be easily installed or upgraded using pip:$python-mpipinstallcolor-harmonyFrom SourceClone the repository or download the folder from github, then navigate to the respective directory and run:pythonsetup.pyinstallUsageTo usecolor-harmony, simply include the path to your image file:$color-harmony[OPTION]...[FilePATH]See alsopython color-harmony --help.ExamplesDefault run on an image file will return both RGB colors and create a color palette image with the same name but with"_colors.png":$color-harmonysample.pngYou can also set the number of clusters, tolerance, and output configurations:$color-harmony-k5-t1.5-otexticon.pngColor Scheme Analysis of Popular Illustrations (Python Notebook on Github)You will need to download the dataset from:https://www.kaggle.com/profnote/pixiv-popular-illustrationsor use your own images.ColorSchemeAnalysis.ipynbMain jupyter notebook for the analysis, can use the data files below:harmonies.csvFile containing the harmonies of each illustration in the dataset.Column names: "Monochromatic", "Complementary", "Split Complementary", "Triad", "Square", "Rectangular", "Analogous", "Other"wheelColors_arr.csvWheel color representations of each illustration in the dataset, starting from Red -> Green -> Blue -> Red.
Package: colorie
I am an upgraded version oftermcolorthat allows you to store colors as objects
and use addition/calling to apply them to text. Color objects can also validate whether you use the correct color
identifiers upon creation, so all errors can be caught early.ExampleimportsysfromcolorieimportColor,colored,cprinttext=colored('Hello, World!','red',attrs=['reverse','blink'])print(text)cprint('Hello, World!','green','on_red')RED_ON_CYAN=Color('red','on_cyan')print(RED_ON_CYAN+'Hello, World!')print(RED_ON_CYAN('Hello, Universe!'))foriinrange(10):cprint(i,'magenta',end=' ')cprint("Attention!",'red',attrs=['bold'],file=sys.stderr)RED=Color('red')ON_WHITE=Color(highlight='on_white')RED_ON_WHITE=RED+ON_WHITEprint(RED+"I am red"+" and I am red!")print(RED+"I am red on white!"+ON_WHITE)Installationpip install colorieText PropertiesText colorsgreyredgreenyellowbluemagentacyanwhiteText highlightson_greyon_redon_greenon_yellowon_blueon_magentaon_cyanon_whiteAttributesbolddarkunderlineblinkreverseconcealedTerminal propertiesTerminalbolddarkunderlineblinkreverseconcealedxtermyesnoyesboldyesyeslinuxyesyesboldyesyesnorxvtyesnoyesbold/blackyesnodttermyesyesyesreverseyesyesteratermreversenoyesrev/redyesnoaixtermnormalnoyesnoyesyesPuTTYcolornoyesnoyesnoWindowsnonononoyesnoCygwin SSHyesnocolorcolorcoloryesMac Terminalyesnoyesyesyesyes
Package: colorific
Image palette detection in Python modelled after Paul Annesley’s color detector
in PHP. colorific determines what the most important colors used in your image
are, and if one of them is a background color.by Dennis Hotson & Lars YenckenInstallationThe easiest way to install colorific is with Python’s pip and virtualenv:$ virtualenv colorific-sandbox
$ ./colorific-sandbox/bin/pip install colorificYou can then run colorific from./colorific-sandbox/bin/colorific.Usagecolorific is meant to run in a streaming manner. You can run it on a single image by echo’ing in the image:$ echo myimage.png | colorific
myimage.png #3e453f,#2ea3b7,#bee6ea,#51544c,#373d38 #ffffffEach input line should be a filename. Each output line will be a tab-delimited string containing the filename, major colors in order, and (optionally) a detected background color.To run on an entire directory tree of images:$ find . -name '*.jpg' | colorificFor a small amount of images, colorific can also be invoked with the image file names provided as arguments:$ colorific myimage.png
myimage.png #3e453f,#2ea3b7,#bee6ea,#51544c,#373d38 #ffffffYou can also get a rendered palette with hex codes for each image with the-oargument:$ colorific -o myimage.png
myimage.png #3e453f,#2ea3b7,#bee6ea,#51544c,#373d38 #ffffff
$ ls
myimage.png  myimage_palette.pngYou can use an experimental multiprocessing mode with the-nargument. For example, to run the same example using 8 processes:$ find . -name '*.jpg' | colorific -p 8You can also get usage information by runningcolorific--help.ExampleHere’s a concrete example of use. This is the NASA Ares logo:Let’s run palette detection on it:$ echo 500px-NASA-Ares-logo.svg.png | colorific
500px-NASA-Ares-logo.svg.png  #0065b9,#bbd6ec,#ff0000These correspond to the colors:Note that black and white have been stripped away, and minor colors introduced
through antialiasing are not present.Changelog0.3.0Python 3 supportBump colormath version to 2.0.20.2.2Use the recent 1.7.8 Pillow release instead of the master branchPin the colormath to 1.0.9 or earlier, given API changes in newer code0.2.1Project renamed tocolorificTuning around quantization and color mergingUse patched Pillow dependency to avoid segmentation fault bugSupport for outputting a palette file per image0.2.0Tuning around background color, similarity thresholds for merging, and minimum saturationMake an importable module0.1.0Functional palette detection
Package: colorifix
Setuppip3 install colorifixRequirementsPython 3.6+UsageIt's very simple to use, just remember three symbols:#to set acolor@to set astyle!to set abackgroundfromcolorifix.colorifiximportpaintpaint("[#red]String to color in red [#blue]and in blue")paint("[#yellow !green]One color and background at a time,[#red #cyan] last set win")paint("[@bold @underline]Many styles in one [@dim]string")paint("[#44 !123]You can use int bash colors")Remove stylesYou canremoveevery part of a style with the symbol/followed by the symbol of the style you want to remove. You can use it alone to remove every styles, it will remove every styles anyway at the end of the string.paint("[#yellow @underline]This is a yellow underline string[/@], now only yellow[/].")Print or not printYou can choose toprintthe string or justsaveit in a variable.colored_str=paint("[!black @dim]Hello Color![/]")# save itppaint("[!42]Again![/]")# print it directlypaint("[!42]Again![/]",False)# print it from main function, same as aboveColorsTo disaply all different colors, you can use the functionsamplefromcolorifix.colorifiximportsamplesample()# base colorssample(complete=True)# to display all bash int colors
Package: colorify
ColorifyDid you find it difficult to read your output in the terminal or while running a python script? Here comes colorify. It will provide you a huge range of color to choose from to print any text in the terminal with color.InstallationInstall python3 :aptinstallpython3Install pip :aptinstallpython3-pipInstall the library :pipinstallcolorifyHow to use?Use in command linelibrary usages:colorify-hOr,colorify--helpOutput____________Example commandscolorify"Random Colored text"colorify"Random Colored text"colorify"Random Colored text"colorify"Random Colored text"colorify"Random Colored text"colorify"Random Colored text"colorify"Random Colored text"colorify"Random Colored text"colorify"Random Colored text"colorify"Random Colored text"Output____________1. First output is generated from light themed terminal
2. Sencond output is generated from dark themed terminalExample commands:# text color = greencolorify-tcgreenSuccess# text color = black , background color = greencolorify-tcblack-bcgreenSucces))colorify-tcredError
colorify-tcwhite-bcredError

colorify-tcorangeAlert
colorify-tcblack-bcorangeAlert

colorify-tcblueInfo
colorify-tcwhite-bcblueInfoOr,# text color = greencolorify--text-colorgreenSuccess# text color = black , background color = greencolorify--text-colorblack--background-colorgreenSucces))colorify--text-colorredError
colorify--text-colorwhite--background-colorredError

colorify--text-colororangeAlert
colorify--text-colorblack--background-colororangeAlert

colorify--text-colorblueInfo
colorify--text-colorwhite--background-colorblueInfoOutput____________1. First output is generated from light themed terminal
2. Sencond output is generated from dark themed terminalUse in python scriptExample code:fromcolorifyimport*# initializing COLORIFYinit_colorify()#this will generate text in random color each timeforiinrange(10):print(colorify("Random Colored text"))Output____________1. First output is generated from light themed terminal
2. Sencond output is generated from dark themed terminalExample code:fromcolorifyimport*# initializing COLORIFYinit_colorify()# text color = greenprint(colorify("Sucess",C.green))# text color = black , background color = greenprint(colorify("Sucess",C.black,C.green))print(colorify("Error ",C.red))print(colorify("Error ",C.white,C.red))print(colorify("Alert ",C.orange))print(colorify("Alert ",C.black,C.orange))print(colorify("Info  ",C.blue))print(colorify("Info  ",C.white,C.blue))Output____________1. First output is generated from light themed terminal
2. Sencond output is generated from dark themed terminalColor optionsIn command line:colorify[-h][-tcTEXT_COLOR][-bcBACKGROUND_COLOR][-l][-v]textList all color:colorify-lOr,colorify-clOr,colorify--color-listIn python script:print(colorify("Your text",C.TEXT_COLOR,C.BACKGROUND_COLOR))List all color:fromcolorifyimport*# initializing COLORIFYinit_colorify()#this will print the list of all available colorprintAllColor()Basic colors:More colors:Need more colors?#use your own RGB colorprint(colorify("Your text",(r,g,b),(r,g,b)))
Package: colorin
Descripción del proyectoEl proyectocolorinconsiste en una clase que permite el coloreado y el formateo de la salida estándar para la terminal en lenguajepython.A su vez, la clase es polimórfica y se puede instanciar indicando los títulos de la cabecera para generar tablas de datos y gráficas de columnas verticales.Uso de la clase y ejemplos:https://github.com/gmolino/colorinVersiones0.0.2Se agrega el método para mostrar gráficas verticales.0.0.1Primer commit con los métodos descritos en el proyecto.
Package: colorir
What is colorir?colorir is a package used to create and manipulate palettes and colors.
What makes colorir different from other similar packages likecolourandpalettableis that colorir focuses on personalization and interoperability:
you can create your own color palettes and use them with any other python package such as matplotlib, tkinter
or flask.Main featuresCreate color schemes and save them to use in different projectsInterpolate colors in different formats (such as RGB, CIELab etc) to make gradients and color mapsHave access to a curated selection of unique color palettes and color namesEasily visualize swatches of colors in the terminalGetting startedIt is very easy to create an original and attractive color palette with colorir:importcolorirasclgrad=cl.PolarGrad(["ffff00","ff00ff"])# Creates a gradient from yellow to magentapalette=cl.StackPalette(grad.n_colors(5))# Samples 5 colors along the gradient and creates a palette with thempalette*=cl.HCLab(1,0.5,1)# Desaturates the palette 50% to get a more pleasing lookcl.swatch(palette)# Shows the palette we created in the terminalcolorir also works seamlessly with other python packages and you don’t have to convert colorir objects to pass
them as input to other frameworks:importmatplotlib.pyplotaspltplt.pie([0.25,0.15,0.20,0.20,0.20],colors=palette)plt.show()For more information (including use-cases and examples), see colorir’s documentationhere.
Package: colorir-terminal
color-terminal - Colorir terminal PythonUm pacote para você colorir seu terminal python, e deixar as coisas mais animada.Instalação do Projeto LocalBaixe o Repositorio:git clone https://github.com/jeffersonalionco/color-terminal.gitEntre na pasta do projeto:cd color-terminalCrie a Variavel de Ambiente:python -m venv venvInstale as dependencias:pip install -r requirements.txt*Agora so executar importar o codigo no seu projeto principalMétodo Simples de Utilizaçãofrommain.pyimport*color('RED','Seu texto')efeitos('FADED','Seu texto')background('RED','Seu Texto')👨‍💻 A Utilização do PIP para baixar a aplicação esta em DesenvolvimentoAUTORES ---------Jefferson L. Alionco
Package: colorise
v1.0.1coloriseprovides easy cross-platform text coloring for terminals/consoles and
hasbeen testedon different platforms/terminals.InstallationInstallcoloriseviapip.pipinstallcoloriseTo get started check out thedocs,tutorialor theexamples.FeaturesSupports 8, 16, 88, 256 colors and true-color.Colors can be specified by name, index, hexadecimal, HLS, HSV or RGB formats.>>>colorise.cprint('Hello',fg='red')>>>colorise.cprint('Hello',bg=201)>>>colorise.cprint('Hello',fg='#a696ff')>>>colorise.cprint('Hello',bg='0xa696ff')>>>colorise.cprint('Hello',fg='hls(0.6923;0.7960;1.0)')>>>colorise.cprint('Hello',fg='hsv(249;41;100)')>>>colorise.cprint('Hello',bg='rgb(167;151;255)')Custom color format akin to Python 3.0string formatting.>>>colorise.fprint('{fg=red}Hello {bg=blue}world!')Automatically find the closest color based on the terminal's
capabilities. Below is sprite of afamiliar plumber.
Pixels are specified as RGB socoloriseautomatically approximates colors
for 256 and 16 color indices in the two right-most images.From left to right: True-color, 256 color and 16 color.Useful functions likehighlightthat highlights
individual characters in a string given a list of indices.Support for attributes such as bold, italic, underline etc.>>>colorise.highlight('Hello world',indices=[0,2,3,7,9],attributes=[Attr.Italic])
Package: colorise-terminal
Colorise TerminalThis package allows you to change the text color, background color and bold of the terminal output.To use it, you only need to import one functionfrom colorise_terminal import cprintcprinthave the same parameters than the regularprintfunctions, but adds 3 more:text_color,bg_colorandboldtext_color:
Color of the text to print, it could be in hex string format:'#FFAA00'; or in RGB tuple
of integer format:(255, 170, 0). Defaults to None.bg_color :
Color of the text background, it could be in hex string format:'#22CC33';or in RGB tuple
of integer format:(34, 204, 51). Defaults to None.bold (bool): Text in bold format. Defaults to False.These are all optional paramaters, so if you omit all of themcprintwill behave as regularprint.Here are some examples of the function working in a terminal session:
Package: colorism
ColorismOverviewThis Python library provides a convenient way to work with ANSI color codes for text and background styling. The library includes classes for text and background styles, a different color palettes, and various color conversion methods. It has a very simple, fast, light and has intuitive syntax.Provides also aConverterwhich contain a set of methods for converting between different color representations. The class supports conversions between RGB, hexadecimal, HSL (Hue, Saturation, Lightness), and HSV (Hue, Saturation, Value) color formats.Key Features:Text and Background Styles:The library provides classes for both text and background styles, allowing users to effortlessly enhance the visual presentation of text content.Support for 8-bit and 24-bit Colors:The library supports both 8-bit and 24-bit colors, allowing users to choose the color depth that best suits their needs.Color Palettes:Explore various color palettes, including standard and intense colors, grayscale, and rainbow palettes, providing flexibility for diverse styling needs.Color Conversion:TheConverterclass makes it easy to switch between different color formats. Users can effortlessly convert colors from RGB, hexadecimal, HSL (Hue, Saturation, Lightness), to HSV (Hue, Saturation, Value).UsagefromcolorismimportFG,BGprint(FG.RED+"Hello World"+FG.RESET)print(BG.RED+"Hello World"+BG.RESET)fromcolorismimportFG,BGprint(FG.bold("Hello World"))print(FG.dim("Hello World"))Advanced UsagefromcolorismimportFG,BGprint(f"{FG.RED+BG.YELLOW}Hello World{FG.RESET+BG.RESET}")print(f"{FG.BOLD+FG.UNDERLINE+FG.GREEN+BG.rgb2escape(0,255,255)}Hello World.{FG.RESET_ALL}")fromcolorismimportFG,BGprint(f"{FG.hsl2escape(60,100,25)+BG.rgb2escape(255,255,255)}Hello World{FG.RESET+BG.RESET}")LicenseThis project is distributed under the MIT License. See theLICENSEfile for more details.