Skip to main content

Greendeck color to vector package.

Project description


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


Install from pip

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.
print("RGB2LAB: \n")
print(color2vec.RGB2LAB([255.0, 0.0, 0.0]))
convert a color string to RGB color space.
# string2RGB
print("string2RGB: \n")
convert a color string to vector.
# string2vec
print("string2vec: \n")
convert a color string to LAB color space.
# string2LAB
print("string2LAB: \n")
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

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

Update your package
* ```python sdist```
* ```twine upload dist/*```


# Thank You

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for color2vec, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size color2vec-1.0.3-py3-none-any.whl (2.4 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size color2vec-1.0.3.tar.gz (8.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page