Skip to main content

Greendeck color to vector package.

Project description

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

Read details about all default parameters and core functions here in RabbitMQ official website. (https://www.rabbitmq.com)

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

Project details


Download files

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

Source Distribution

color2vec-1.0.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

color2vec-1.0.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file color2vec-1.0.0.tar.gz.

File metadata

  • Download URL: color2vec-1.0.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for color2vec-1.0.0.tar.gz
Algorithm Hash digest
SHA256 094f91fa9ba44d5d89e966e891f1cf8308b2381defaf1316fe31179f651b0d0b
MD5 f917d749661551f83e59b7a8deda08a3
BLAKE2b-256 3dd6628530050d1f5d96658ce44bc86bacafc4fb8ce3ecc4fbc480665732486e

See more details on using hashes here.

File details

Details for the file color2vec-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: color2vec-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for color2vec-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 452c79866b500fe591b2d2123370c0b01dbaf864f11633d477db9a7921450616
MD5 7acd01e3feb6a3eaaffc1816f0c843ce
BLAKE2b-256 4387e7f22983d9c848575138f3194cd814e8e659ca217b2fe76676dabe50f1e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page