GithubHelp home page GithubHelp logo

drtrigon / pycolorname Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abdealiloko/pycolorname

0.0 2.0 0.0 1.47 MB

License: MIT License

Python 81.38% Shell 2.87% JavaScript 4.76% HTML 10.99%

pycolorname's Introduction

Introduction

pycolorname is a python package that aims to provide common color systems scraped from various sites.

Supported systems

  • Pantone
  • RAL-Classic

Installation

The easiest way to install the library is using pip. To install the latest stable version run:

$ pip install pycolorname

To get bightly builds from the master branch of the github repo, use:

$ pip install --pre pycolorname

Usage

To use a color system to name colors (for given RGB color tuples (red, greed, blue)), import a source from the module corresponsing to the system and create an instance of it. Then use find_closest like:

>>> from pycolorname.pantone.pantonepaint import PantonePaint
>>> pantone_colors = PantonePaint()
>>> pantone_colors.find_closest((23, 73, 80))
"PMS 19-4914 TPX (Deep Teal)"

To use the pantone color system, find the sources available in the pycolorname.pantone module and use one of them. For example, the PantonePaint source can be used in the following manner:

>>> from pycolorname.pantone.pantonepaint import PantonePaint
>>> pantone_colors = PantonePaint()
>>> pantone_colors["PMS 19-4914 TPX (Deep Teal)"]
(23, 73, 80)

Another example using the RAL-Classic color system from the Wikipedia source:

>>> from pycolorname.ral.classic.wikipedia import Wikipedia
>>> ral_colors = Wikipedia()
>>> ral_colors["RAL 1000 (Green beige)"]
(204, 197, 143)

Development

Testing

To test the code, install dependencies using:

$ pip install -r test-requirements.txt

and then execute:

$ python -m pytest

Running tests will automatically update the database of files used by the color systems by fetching it from the respective sources.

Build status

CircleCI Status

Credits

This package has been derived from pywikibot/pycolorname. Which in turn was extracted out of pywikibot/compat. These packages were created by DrTrigon who is the original author of this package.

LICENSE

MIT

This code falls under the MIT License. Please note that some files or content may be copied from other places and have their own licenses. Dependencies that are being used to generate the databases also have their own licenses.

pycolorname's People

Contributors

abdealiloko avatar drtrigon avatar somechris avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.