{ "info": { "author": "Marcos A Ojeda", "author_email": "marcos@generic.cx", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Artistic Software", "Topic :: Multimedia :: Graphics", "Topic :: Multimedia :: Graphics :: Graphics Conversion", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Swatch\n======\n\nswatch is a parser for adobe swatch exchange files\n\nCopyright (c) 2014 Marcos A Ojeda http://generic.cx/\n\n\nWith help from ASE documentation written by\n`Carl Camera `_ and\nthe ase generator written for colourlovers by\n`Chris Williams `_\n\n``swatch.write(lst, filename)`` reads in a list, as described below\nand outputs a .ase file. (new in v0.4.0)\n\n``swatch.parse(filename)`` reads in an ase file and converts it to a\nlist of colors and palettes. colors are simple dicts of the form::\n\n {\n 'name': u'color name',\n 'type': u'Process',\n 'data': {\n 'mode': u'RGB',\n 'values': [1.0, 1.0, 1.0]\n }\n }\n\nthe values provided vary between color mode. For all color modes, the\nvalue is always a list of floats.\n\nRGB: three floats between [0,1] corresponding to RGB.\nCMYK: four floats between [0,1] inclusive, corresponding to CMYK.\nGray: one float between [0,1] with 1 being white, 0 being black.\nLAB: three floats. The first L, is ranged from 0,1. Both A and B are\nfloats ranging from [-128.0,127.0]. I believe illustrator just crops\nthese to whole values, though.\n\nPalettes (Color Groups in Adobe Parlance) are also dicts, but they have an\nattribute named ``swatches`` which contains a list of colors contained within\nthe palette.::\n\n {\n 'name': u'accent colors',\n 'type': u'Color Group',\n 'swatches': [\n {color}, {color}, ..., {color}\n ]\n }\n\nBecause Adobe Illustrator lets swatches exist either inside and outside\nof palettes, the output of swatch.parse is a list that may contain\nswatches and palettes, i.e. [ swatch* palette* ]\n\nHere's an example with a light grey swatch followed by a color group containing\nthree swatches::\n\n >>> import swatch\n >>> swatch.parse(\"example.ase\")\n [{'data': {'mode': u'Gray', 'values': [0.75]},\n 'name': u'Light Grey',\n 'type': u'Process'},\n {'name': u'Accent Colors',\n 'swatches': [{'data': {'mode': u'CMYK',\n 'values': [0.5279774069786072,\n 0.24386966228485107,\n 1.0,\n 0.04303044080734253]},\n 'name': u'Green',\n 'type': u'Process'},\n {'data': {'mode': u'CMYK',\n 'values': [0.6261844635009766,\n 0.5890134572982788,\n 3.051804378628731e-05,\n 3.051804378628731e-05]},\n 'name': u'Violet Process Global',\n 'type': u'Global'},\n {'data': {'mode': u'LAB', 'values': [0.6000000238418579, -35.0, -5.0]},\n 'name': u'Cyan Spot (global)',\n 'type': u'Spot'}],\n 'type': u'Color Group'}]\n\nSpot, Global and Process\n------------------------\n\nSomething that's not mentioned in either carl camera's or chris william's code\nis the mention of spot, global and process colors.\n\nThere are three kinds of swatch types available to you in a ASE files: Process,\nGlobal and Spot. Process colors are standard colors, this is the default if you\ndefine a new color in illustrator. As the name implies, they're mixed from either\nRGB or CMYK depending on the document color mode.\n\nGlobal colors are the same thing as process colors, but they have one neat property\nwhich is that when you update them, they are updated all throughout your artwork.\nThis makes them something like \"color references\" and quite useful if you're doing\nsomething like reskinning some extant document.\n\nSpot colors are implicitly global but have the nifty property that you can create\nnew swatches from them based on \"tints\" or, effectively some screened value of that\ncolor. The only hitch is that tints, even though they can be part of your file,\ncan't be stored/exchanged as swatches. I'm on the fence as to how problematic this\nis, but that's just how it goes. Even illustrator won't save them out, it's just\nnot supported in the app (almost certainly due to the nature of the file format)\n\nCaveats\n-------\n\nFinally, consider the fact that your swatches can be CMYK a mixed blessing.\nWhile this is invariably useful if you need to import some old swatches for\nprint work, it will pose a challenge for accurately converting back to RGB/LAB\nunless you have a copy of illustrator handy.\n\nIf you don't, you can always install color profile calculator in the (oddly\nnamed) `little cms `_ and feed it the freely\navailable SWOP icc color profile and use the default output of sRGB to get\nyour colors in a somewhat usable form for the web.\n\nIf you end up with LAB spot colors, you can always pay\n`Bruce Lindbloom `_ a\nvisit to get the relatively easy, if somewhat time consuming, LAB->XYZ->RGB\nformulas.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/nsfmc/swatch", "keywords": null, "license": "Copyright (C) 2011 by Marcos Ojeda, generic.cx\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "swatch", "package_url": "https://pypi.org/project/swatch/", "platform": "any", "project_url": "https://pypi.org/project/swatch/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/nsfmc/swatch" }, "release_url": "https://pypi.org/project/swatch/0.4.0/", "requires_dist": null, "requires_python": null, "summary": "a parser for adobe swatch exchange files", "version": "0.4.0" }, "last_serial": 1062573, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "ca7bccff6f35b4d26bbb4db741da961d", "sha256": "5e8c037c8f21d2af2f0af2485015c974c220eb598c4a0ab78058d5202ce4d45d" }, "downloads": -1, "filename": "swatch-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ca7bccff6f35b4d26bbb4db741da961d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3915, "upload_time": "2012-12-28T14:00:05", "url": "https://files.pythonhosted.org/packages/00/50/ec14266f4976907ffbf99770cfa8fb06c29b21bc21e76831b59a0a37e4de/swatch-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "58a0fd9468ddd35acc16e9c69ef31126", "sha256": "ffef94ed7919b02ad06a9fd174138b6af478be7f109c87c5190ad57ecd2121cb" }, "downloads": -1, "filename": "swatch-0.2.2.tar.gz", "has_sig": false, "md5_digest": "58a0fd9468ddd35acc16e9c69ef31126", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4511, "upload_time": "2012-12-28T14:28:54", "url": "https://files.pythonhosted.org/packages/17/54/afa444a1dada2f4ebfdcb42c479d598f7aebc594ea18f8e83de6133de27a/swatch-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "6faf9e4bd4d896288f955696f47f3642", "sha256": "050eee3031f0122657e2485dd719a222d4bee8cc5b878415775d416724eb8e41" }, "downloads": -1, "filename": "swatch-0.2.3.tar.gz", "has_sig": false, "md5_digest": "6faf9e4bd4d896288f955696f47f3642", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6292, "upload_time": "2012-12-30T15:43:33", "url": "https://files.pythonhosted.org/packages/4b/06/5a035ba023768bdc3cbde91c465677b766cfcac21c61f7130b18d4e21ce5/swatch-0.2.3.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "f060894d6953338837dbb930984877ed", "sha256": "62128bef3dc57eeb3c5715df0ae05e2c455ba22cea06808172fdeae6fe06ef05" }, "downloads": -1, "filename": "swatch-0.3.0.tar.gz", "has_sig": false, "md5_digest": "f060894d6953338837dbb930984877ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4802, "upload_time": "2013-07-01T04:52:48", "url": "https://files.pythonhosted.org/packages/a7/df/288cb20d5a1c3f36a161eeb292eb18283ca2ca0a493358cbe1d3d30c0d70/swatch-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "7a0ac986e49930b2ff4f2c209f1c5716", "sha256": "9bb52cbaf8c8ec8a3105c13d88fadc498a440d92c6a57fe59fe0aed1a0909ceb" }, "downloads": -1, "filename": "swatch-0.3.1.tar.gz", "has_sig": false, "md5_digest": "7a0ac986e49930b2ff4f2c209f1c5716", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6571, "upload_time": "2013-07-01T04:57:50", "url": "https://files.pythonhosted.org/packages/8d/8f/34526ca52e3e3283073fce76006e1520afcf55b663925ad0b247ecf70c10/swatch-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "cacea12eec182c4d961f8a7b2b091474", "sha256": "f531c5b7956cec98f00c8e2135214b4608963d43e9694c73eb092abcc61a317b" }, "downloads": -1, "filename": "swatch-0.4.0.tar.gz", "has_sig": false, "md5_digest": "cacea12eec182c4d961f8a7b2b091474", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7038, "upload_time": "2014-04-16T17:14:16", "url": "https://files.pythonhosted.org/packages/23/8d/cfe28e69b941e0972d6eb4859f372d57444feb097247aea5cf9c9e9577e2/swatch-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cacea12eec182c4d961f8a7b2b091474", "sha256": "f531c5b7956cec98f00c8e2135214b4608963d43e9694c73eb092abcc61a317b" }, "downloads": -1, "filename": "swatch-0.4.0.tar.gz", "has_sig": false, "md5_digest": "cacea12eec182c4d961f8a7b2b091474", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7038, "upload_time": "2014-04-16T17:14:16", "url": "https://files.pythonhosted.org/packages/23/8d/cfe28e69b941e0972d6eb4859f372d57444feb097247aea5cf9c9e9577e2/swatch-0.4.0.tar.gz" } ] }