{ "info": { "author": "Roy Prins", "author_email": "prinsroy@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "## HSLA colors for HTML\n\nWith CSS3 the hsl(a) color values were introduced. These have had cross browser \nsupport since early 2011, yet see only limited use.\n\nPossibly because the existing `#ff1ab3` hex-style colors offer the same palet and \nwere always supported across browsers. With universal browser support for hsla, \nthe time is overdue to challenge this.\n\nThis library offers a naming system for selectors and a python Hsla class \nto manage colors for use in CSS generators.\n\n## Why use hsl(a) colors?\n\n+ Hex colors offer no opacity, necessitating a partial switch to rgba or hsla \ncolors anyways (this may change with the CSS4 spec).\n+ Graphical designers are used to working with hsla, as it is the color picker \nin applications such as Sketch.\n+ It makes it easier to reason about colors: a lower luminosity means a darker color; \na higher saturation means more vibrant.\n\nIt also opens the door to more uniform, expansive and unambiguous naming of color \nselectors. The existing \"semantic\" approaches do not work well in most cases and \ngive the designer non-descriptive class names such as `color-secondary` or bastardly \ndescriptions as `color-primary-darker`. Descriptive solutions are often limited in \nscope (`darkest-blue` *will we also need a darkest-darkest blue?*) and fall short of \ngiving a proper representation (`near-white` *how near?*)\n\n## About hues\n\nIt is easy to see that color `hsla(30, 100%, 50%, 0.7)` is a vibrant color, \nlight neither dark and with 70% opacity. It is less clear or \"human-friendly\" \nto find out what hue 30 is supposed to represent. Spoiler: it's an orangy hue.\n\nThis library contains a well-thought-out system to address various hues by name. \nThe following were the considerations:\n \n + A named hue for every 10 steps on the hue scale, resulting in 36 hues;\n + When the hues match a HTML color for 100% saturation and 50% luminosity, the \n HTML color is used for the hue (0: `red`, 60 `yellow`, 120: `lime`, 180: `cyan`, 240: `blue` \n & 300 `magenta`)\n + For the other names, the HTML color names are avoided to prevent ambiguity and confusion.\n + All other names are single-words and do not contain other color names, again to be \n unambiguous (no \"cornflower blue\")\n + The names were chosen to be broadly recognized and memorable, often the colors of \n minerals, plants, etc.\n\n## Getting started\n\n### Creating hsla colors\n\nThe hue names and integer values in the naming sytem combine to create more than 345 million \ncolors. Here is how you would create: \n+ a dark orange/red\n+ a muted & light lila/blue\n+ a black with 60% opacity:\n \n```python\nfrom hsla import Hsla\n\ncolor1 = Hsla('scarlet', lum=18)\ncolor2 = Hsla('majorelle', 40, 80)\ncolor3 = Hsla('black', alpha=60)\n```\nSuppose we want to use the colors we created for genetating CSS selectors and values. \n\n```python\n# The hsl representation is used with alpha=100\nprint(color1) \n# 'hsl(10, 100%, 18%)'\n\ncolor1.suffix \n# 'scarlet-18'\n\nprint(color2) \n# 'hsl(250, 40%, 80%)\n\ncolor2.suffix \n# 'majorelle40-80'\n\nprint(color3) \n# 'hsla(0, 0, 0, 0.6)'\n\ncolor3.suffix \n# 'black-60a'\n```\n\nNotice that for the selectors, the saturation value is directly attached to the hue. \nThe luminosity and alpha values by a hyphen and the latter has an 'a' suffixed. All \nvalues other than than the hue are optional. They default to:\n\n+ `100` for saturation (`0` for black, white and gray)\n+ `50` for luminosity (`0` for black, `100` for white and gray lies in between)\n+ `100` for alpha\n\nMore formally: `[][-][-a]`\n\n### Generate a palet\n\nThe code below uses a catesian product of hues, saturations and luminosities to quickly \ngenerate a color palet. Bear in mind that this method is exponential with the value count, \nso you may end up generating many colors.\n\n```python\ncolors = [Hsla(*hsl) for hsl in itertools.product(list(HUES)[::3], (100, 60), (92, 70, 50, 25))]\n``` \n\nNotice that we take every 3rd value from the keys of the HUES dictionary (=12) **x** \n2 saturation values **x** 4 luminosities to get a palet of 96 colors and shades. We may \nalso want to generate gray in muliple luminosities and black & white in various opacities:\n\n```python\n# Grays from various luminosities\ngrays = [Hsla('gray', lum=l) for l in (98, 95, 90, 80, 50, 65, 35, 20, 10, 5)]\n\n# Blacks and whites from various alpha values\nblack_white = [Hsla(h, alpha=a) for h in ['black', 'white'] for a in (100, 80, 60, 40, 20, 10, 5)]\n```\n\nWe now have a perfectly usable palet for use in a CSS generator such as Glueball.\n\n```python\npalet = colors + grays + black_white\n\npalet[51].suffix\n# cobalt60-70\n```\n\n### Hsla in your project\n\nThis method above may be suitable to create a palet for a versatile framework or \nfor flexibility early in the development phase. \n\nIt is just as easy to create the colors individually for your project, or you can \nforego the Hsla class altogether and only use the method to create consistent and readable \nnames throughout your projects.\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/glueball-hsla", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Glueball-hsla", "package_url": "https://pypi.org/project/Glueball-hsla/", "platform": "", "project_url": "https://pypi.org/project/Glueball-hsla/", "project_urls": { "Homepage": "http://pypi.python.org/pypi/glueball-hsla" }, "release_url": "https://pypi.org/project/Glueball-hsla/1.1.2/", "requires_dist": null, "requires_python": "", "summary": "HSLA color naming system for use in CSS generators", "version": "1.1.2" }, "last_serial": 3512343, "releases": { "0.0.1.dev2": [ { "comment_text": "", "digests": { "md5": "59a4e5742fcf05481ed6fea541cbda35", "sha256": "d3b3ff238282fa6e83d7a3ec5ece74394f904575c30b1de5c8eb450f3c66907f" }, "downloads": -1, "filename": "Glueball-hsla-0.0.1.dev2.tar.gz", "has_sig": false, "md5_digest": "59a4e5742fcf05481ed6fea541cbda35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5831, "upload_time": "2018-01-20T12:54:02", "url": "https://files.pythonhosted.org/packages/36/03/8f9426ae7fc62060904833490e436251e76d7c9c3bab310dc2f2b5112592/Glueball-hsla-0.0.1.dev2.tar.gz" } ], "0.0.1.dev4": [ { "comment_text": "", "digests": { "md5": "80af5c04ee8551728a708a89bb3b7d52", "sha256": "2031ed5b10e8f903f536549aa4a329ed18b2adf89ca5dda3a31a78ca81251ea7" }, "downloads": -1, "filename": "Glueball-hsla-0.0.1.dev4.tar.gz", "has_sig": false, "md5_digest": "80af5c04ee8551728a708a89bb3b7d52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5745, "upload_time": "2018-01-20T15:07:21", "url": "https://files.pythonhosted.org/packages/97/8f/5ecbb0fe48ce5a57423adf8420d88308cc387d31299efb4f7aed7a812f1a/Glueball-hsla-0.0.1.dev4.tar.gz" } ], "0.0.1.dev5": [ { "comment_text": "", "digests": { "md5": "daa5eb97571ff42f1168d942a6831565", "sha256": "6eb6fe7d2e06efcbb8d952fa44fc254cf98016e84a0df6f7ac95d9e3c9c741d6" }, "downloads": -1, "filename": "Glueball-hsla-0.0.1.dev5.tar.gz", "has_sig": false, "md5_digest": "daa5eb97571ff42f1168d942a6831565", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5811, "upload_time": "2018-01-20T18:56:33", "url": "https://files.pythonhosted.org/packages/43/bf/414cb59802ffa846feed0c6babe2f876670c46299e178ac7ec008e47efa6/Glueball-hsla-0.0.1.dev5.tar.gz" } ], "0.0.1.dev6": [ { "comment_text": "", "digests": { "md5": "9f721db868b4ff71eac6bc534f4479a5", "sha256": "7fd51d5fa3eaa704c6fc7051538f16b8129c7392e078be94170a1a3cbf5db3df" }, "downloads": -1, "filename": "Glueball-hsla-0.0.1.dev6.tar.gz", "has_sig": false, "md5_digest": "9f721db868b4ff71eac6bc534f4479a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5825, "upload_time": "2018-01-20T19:02:21", "url": "https://files.pythonhosted.org/packages/81/ec/d097ca0741dc8fe1de1aa8fe70650974144f3aa00953cfb96a118cf8af50/Glueball-hsla-0.0.1.dev6.tar.gz" } ], "0.0.1.dev8": [ { "comment_text": "", "digests": { "md5": "197f3c18c0f9a857db4c06bcba1d4d81", "sha256": "d5dd1727f78766c933cc3be27df9d285fbb09798fba4a22422c351c008976684" }, "downloads": -1, "filename": "Glueball-hsla-0.0.1.dev8.tar.gz", "has_sig": false, "md5_digest": "197f3c18c0f9a857db4c06bcba1d4d81", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5985, "upload_time": "2018-01-21T18:48:30", "url": "https://files.pythonhosted.org/packages/3d/d0/0f281e719af970a38672aca61112b1b7bb2e1f46ea2b001c5c4603dca642/Glueball-hsla-0.0.1.dev8.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "eaec2526fb04c5255e545005b1fb5156", "sha256": "d426724a93b7f84b7ab1418090f3939cfcdcb7260b9f1461f24392b00e6d18d4" }, "downloads": -1, "filename": "Glueball-hsla-1.1.2.tar.gz", "has_sig": false, "md5_digest": "eaec2526fb04c5255e545005b1fb5156", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5981, "upload_time": "2018-01-22T21:23:30", "url": "https://files.pythonhosted.org/packages/7c/6e/7397efefaa974f85c192680e55d1d39d9ae6c444ea35db60b84cb1c2be8f/Glueball-hsla-1.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "eaec2526fb04c5255e545005b1fb5156", "sha256": "d426724a93b7f84b7ab1418090f3939cfcdcb7260b9f1461f24392b00e6d18d4" }, "downloads": -1, "filename": "Glueball-hsla-1.1.2.tar.gz", "has_sig": false, "md5_digest": "eaec2526fb04c5255e545005b1fb5156", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5981, "upload_time": "2018-01-22T21:23:30", "url": "https://files.pythonhosted.org/packages/7c/6e/7397efefaa974f85c192680e55d1d39d9ae6c444ea35db60b84cb1c2be8f/Glueball-hsla-1.1.2.tar.gz" } ] }