Package: adobe-color-swatch
Adobe Color SwatchDescriptionswatch.pyis a Python 3 command line interface created to extract Color
Swatch data from.acofiles and save them as a simple.csv. It can also
work in revers and generate a.acofile based on a.csvdata file.InstallationInstall from GitHub repository:pip3 install git+https://github.com/kdybicz/adobe-color-swatchUsageExtract.acousage: swatch extract [-h] -i INPUT -o OUTPUT [-v]

Extract .aco input file to a .csv output file

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        input file
  -o OUTPUT, --output OUTPUT
                        output file
  -v, --verbose         increase output verbosityGenerate.acousage: swatch generate [-h] -i INPUT -o OUTPUT [-v]

generate .aco output file based on .csv input file

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        input file
  -o OUTPUT, --output OUTPUT
                        output file
  -v, --verbose         increase output verbositySpecification.acofile format parser and generator were created based onAdobe Color Swatch File Format Specification.
Script is supporting both version 1 and 2 of the Color Swatch format..csvfile is using custom format:name,space_id,color
RGB Magenta 16-bit,0,#FF00FF
RGB Magenta 32-bit,0,#FFFF0000FFFF
CMYK Magenta 16-bit,2,#FF00FFFF
CMYK Magenta 32-bit,2,#FFFF0000FFFFFFFF
75% Gray,8,#1D4CColor space IDsSupported color spacesIDNameColor information0RGBSupports 16 and 32 bit channels, so accordingly 6 or 12 bytes of color information1HSBSupports 16 and 32 bit channels, so accordingly 6 or 12 bytes of color information2CMYKSupports 16 and 32 bit channels, so accordingly 8 or 16 bytes of color information8GrayscaleSupports 16 and 32 bit channel, so accordingly 2 or 4 bytes of color informationNOT supported color spacesIDName3Pantone matching system4Focoltone colour system5Trumatch color6Toyo 88 colorfinder 10507Lab10HKS colorsValidationTo validate that the.acofile generation is working properly I decided on
the following process:export few default Color Swatches from Adobe Photoshop 2022extract them to.csvfiles and make sure data in that files are matching
to what is in the Adobe Photoshopgenerate new.acofiles from.csvacquired in the previous stepcompare original.acofiles with ones regenerated from.csvusing:hexdump examples/utf.aco > utf.aco.hex
hexdump utf-new.aco > utf-new.aco.hex
diff utf.aco.hex utf-new.aco.hex -yimport new.acofiles into Adobe Photoshop and compare them with original
SwatchesNotesI'm aware that original.acofiles contain some additional bytes at the end
of the files. Those bytes which will not be present in.acofiles generated
by the script. These bytes might be related toCustom color spaces,
which are not supported by this script.Nevertheless I was able to successfully import generated.acofiles back into
the Adobe Photoshop and use them in my work!DevelopmentTesting and lintingFor all supported environments:tox --parallelNote: running tests for all supported Python versions require to have
Python interpreters  for those versions to be installed.For particular environment:tox -e py39For running tests in development environment:tox --devenv venv -e py39
. venv/bin/activate
pytestLocal installationInstall a project in editable mode:pip3 install -e .DeploymentBuilding the packages:./venv/bin/python setup.py sdist bdist_wheelChecking if build packages are valid:twine check dist/*Uploading to pypi:twine upload -r pypi dist/*