Skip to main content

Color2Vec

Right now this package is only for greendeck's internal use. This will help to get vectors for a color text or RGB value.

Greendeck

Install from pip

https://pypi.org/project/color2vec/

pip install color2vec

How to use ?

import the library
import color2vec
import Color2Vec class
from color2vec import Color2Vec
initialize Color2Vec object.
color2vec = Color2Vec()
convert RGB to Vector
# RGB2vec
print("RGB2vec: \n")
print(color2vec.RGB2vec([255.0, 0.0, 0.0]))
convert RGB to LAB color space.
# RGB2LAB
print("RGB2LAB: \n")
print(color2vec.RGB2LAB([255.0, 0.0, 0.0]))
convert a color string to RGB color space.
# string2RGB
print("string2RGB: \n")
print(color2vec.string2RGB("Greendeck"))
convert a color string to vector.
# string2vec
print("string2vec: \n")
print(color2vec.string2vec("Greendeck"))
convert a color string to LAB color space.
# string2LAB
print("string2LAB: \n")
print(color2vec.string2LAB("Greendeck"))
Build an Annoy index.
# Annoy Index
color2vec.buildAnnoy(items, type="string")

'''
Items is a list datatype. It can contains either list of color string or RGB colors. Type can be `string` or `RGB`
'''
Find similar items from an annoy index.
# Annoy Index
color2vec.similar(target, build_annoy, k=5, include_distance=True)

'''
target can be a color string or RGB array, k is the no of similar items you want. Keep include distance `True` if you want distance across all similar items.
'''
Find distance between two item.
# Annoy Index
color2vec.distance(items, type="string")



'''
Length of items array should be two. Type can be `string` or `RGB` based on items type.'''


How to build your pip package

* open an account here https://pypi.org/

In the parent directory
* ```python setup.py sdist bdist_wheel```
* ```twine upload dist/*```

Update your package
* ```python setup.py sdist```
* ```twine upload dist/*```

references
* https://medium.com/small-things-about-python/lets-talk-about-python-packaging-6d84b81f1bb5
* https://packaging.python.org/tutorials/packaging-projects/RabbitMQ

# Thank You

Metadata

Release files for color2vec 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for color2vec 1.0.3
File Size Uploaded Provenance Actions
color2vec-1.0.3.tar.gz 8.9 kB Without provenance Details for color2vec-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for color2vec 1.0.3
File Interpreter ABI Platform Actions
color2vec-1.0.3-py3-none-any.whl Python 3 none any Details for color2vec-1.0.3-py3-none-any.whl

Total release size: 2.4 MB

Release files / color2vec-1.0.3.tar.gz

Download URL color2vec-1.0.3.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
40210e7e440cd3013fb864176bcab8261bb06f89f5ce106f517cbc5f68c6aa89
BLAKE2b-256 checksum
How to use checksums
4f032e7b0a56e4a6f1fd8c2c630e02812ff84d2d3c2df05ead937f868e2516f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release files / color2vec-1.0.3-py3-none-any.whl

Download URL color2vec-1.0.3-py3-none-any.whl
Size 2.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3db3375125b02d4b8ae503e76e1ded1a6ecf9be6555542509855bf15267c8072
BLAKE2b-256 checksum
How to use checksums
09625a97cd7555d6f9265ec73607b3873b581436ad5fdcf60f9dc45fc0886705
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Security for color2vec 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page