{"id":13442826,"url":"https://github.com/privet-kitty/dufy","last_synced_at":"2026-01-14T11:22:01.497Z","repository":{"id":88064401,"uuid":"112779935","full_name":"privet-kitty/dufy","owner":"privet-kitty","description":"Colorimetry library for Common Lisp","archived":false,"fork":false,"pushed_at":"2023-10-22T11:36:40.000Z","size":2489,"stargazers_count":45,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-13T13:37:39.134Z","etag":null,"topics":["color","colorimetry","common-lisp","munsell"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/privet-kitty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-12-01T19:43:31.000Z","updated_at":"2025-03-04T00:13:29.000Z","dependencies_parsed_at":"2023-03-04T14:30:28.262Z","dependency_job_id":null,"html_url":"https://github.com/privet-kitty/dufy","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/privet-kitty/dufy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privet-kitty%2Fdufy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privet-kitty%2Fdufy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privet-kitty%2Fdufy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privet-kitty%2Fdufy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/privet-kitty","download_url":"https://codeload.github.com/privet-kitty/dufy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privet-kitty%2Fdufy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28418282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["color","colorimetry","common-lisp","munsell"],"created_at":"2024-07-31T03:01:51.766Z","updated_at":"2026-01-14T11:22:01.475Z","avatar_url":"https://github.com/privet-kitty.png","language":"Common Lisp","funding_links":[],"categories":["Common Lisp","Miscellaneous ##"],"sub_categories":[],"readme":"Dufy - Color Library for Common Lisp\n====\n[![Build Status](https://github.com/privet-kitty/dufy/workflows/CI/badge.svg)](https://github.com/privet-kitty/dufy/actions)\n[![Quicklisp dist](http://quickdocs.org/badge/dufy.svg)](http://quickdocs.org/dufy/)\n\nDufy is a library for exact color manipulation and conversion in various color spaces, which supports the following color models:\n\n* RGB\n* XYZ and xyY\n* CIELAB and LCh\u003csub\u003eab\u003c/sub\u003e\n* CIELUV and LCh\u003csub\u003euv\u003c/sub\u003e\n* HSV and HSL\n* HSL\u003csub\u003euv\u003c/sub\u003e and HPL\u003csub\u003euv\u003c/sub\u003e\n* Munsell Color System\n* LMS\n* spectrum (as spectral power distribution function)\n\nDufy can deal with the following concepts:\n\n* Illuminant: A, B, C, D series, F series, etc. A new illuminant can be defined by white point or SPD.\n* RGB space: sRGB, Adobe RGB, scRGB, etc.  A new RGB space can be defined by primary coordinates, illuminant, method of gamma correction, bit per channel and other encoding characteristics.\n* Observer (Color Matching Functions): CIE 1931 2\u0026deg; Standard Observer, CIE 1964 10\u0026deg;. Other observer model can be defined by color matching data.\n* Color difference: \u0026Delta;E\u003csup\u003e*\u003c/sup\u003e\u003csub\u003eab\u003c/sub\u003e, CIE94, CIEDE2000, CMC l:c.\n* Chromatic adaptaion transform: Bradford, Von Kries, etc. User-defined CAT is also available.\n\n## Documentation\nBesides this README file, most of the documentation is written as docstrings in the source code. [Quickdocs](http://quickdocs.org/dufy/) will be helpful to overview them. Some other information (e.g. changes between versions) is in [github wiki](https://github.com/privet-kitty/dufy/wiki).\n\n## Dependencies\n\n* alexandria\n* cl-ppcre\n\nYou can install all of the dependent libraries via quicklisp.\n\n## Install\nThe easiest way to install dufy is to use [quicklisp](https://www.quicklisp.org/beta/):\n\n    * (ql:quickload :dufy)\n\nThe latest version in this repository can also be loaded with quicklisp:\n\n    $ cd ~/quicklisp/local-projects   # the path is held in ql:*local-project-directories*\n    $ git clone git@github.com:privet-kitty/dufy.git\n    $ sbcl   # , ccl, etc.\n    \n    * (ql:register-local-projects)\n    * (ql:quickload :dufy)\n\nIf you want to load the ASDF system directly without quicklisp, you should put the directory of dufy to an appropriate location (e.g. `~/common-lisp/dufy/`) and do `(asdf:load-system :dufy)`.\n\nNote that the `master` branch always coincides with the latest stable release. The `develop` branch is usually where development happens.\n\n## Basic Usage\n![Tree of Direct Converters](https://g.gravizo.com/source/converter_tree?https%3A%2F%2Fraw.githubusercontent.com%2Fprivet-kitty%2Fdufy%2Fdevelop%2FREADME.md)\n\n\u003cdetails\u003e \n\u003csummary\u003e\u003c/summary\u003e\nconverter_tree\n  graph G {\n    graph [\n      labelloc = \"t\",\n      label = \"Tree of Primary Converters\",\n      fontsize = 16\n    ];\n    node [\n      shape = \"box\",\n      fontname = \"helvetica\",\n      fontsize = 14\n    ];\n    xyz [ label = \"XYZ\" ]\n    xyy [ label = \"XYY\\n(xyY)\" ]\n    lrgb [ label = \"LRGB\\n(linear RGB)\" ]\n    rgb [ label = \"RGB\\n(gamma-corrected RGB)\" ]\n    qrgb [ label = \"QRGB\\n(quantized RGB)\" ]\n    rgbpack [ label = \"RGBPACK\\n(packed to an int.)\" ]\n    rgba [ label = \"RGBA\\n(gamma-corrected RGBA)\" ]\n    qrgba [ label = \"QRGBA\\n(quantized RGBA)\" ]\n    rgbapack [ label = \"RGBAPACK\\n(packed to an int.)\" ]\n    lab [ label = \"LAB\" ]\n    lchab [ label = \"LCHAB\" ]\n    luv [ label = \"LUV\" ]\n    lchuv [ label = \"LCHUV\" ]\n    mhvc [ label = \"MHVC\\n(Munsell 3-number spec.)\" ]\n    munsell [ label = \"MUNSELL\\n(Munsell string spec.)\" ]\n    hsv [ label = \"HSV\" ]\n    hsl [ label = \"HSL\" ]\n    hsluv [ label = \"HSLUV\" ]\n    hpluv [ label = \"HPLUV\" ]\n    spectrum [ label = \"SPECTRUM\" ]\n    lms [ label = \"LMS\" ]\n    xyz -- xyy\n    xyz -- lms\n    xyz -- spectrum\n    xyz -- lrgb\n    lrgb -- rgb\n    rgb -- qrgb\n    qrgb -- rgbpack\n\n    rgba -- qrgba\n    qrgba -- rgbapack\n  \n    xyz -- lab\n    lab -- lchab\n    xyz -- luv\n    luv -- lchuv\n    lchuv -- hsluv\n    lchuv -- hpluv\n    rgb -- hsv\n    rgb -- hsl\n\n    lchab -- mhvc  [ label = \"(illuminant C)\" ]\n    mhvc -- munsell\n\n    { rank=same; rgb rgba }\n  }\nconverter_tree\n\u003c/details\u003e\n\nThe fundamental color space of dufy is CIE XYZ (Illuminant D65): There are `xyz-to-` and `-to-xyz` converters for all other (connected) color spaces. Every converter function just receives numbers and returns multiple numbers:\n\n```lisp\n(dufy:lab-to-xyz 87.07 -78.15 -20.51)  ; L*=87.07, a*=-78.15, b*=-20.51\n;; =\u003e 0.3731544163010862d0 ; X\n;;    0.701492216468595d0  ; Y\n;;    1.0600774614243746d0 ; Z\n   \n(multiple-value-call #'dufy:xyz-to-qrgb\n  (dufy:lab-to-xyz 87.07 -78.15 -20.51)\n  :clamp nil)\n;; =\u003e -169 ; R\n;;    255  ; G\n;;    255  ; B\n\n(multiple-value-call #'dufy:xyz-to-qrgb\n  (dufy:lab-to-xyz 87.07 -78.15 -20.51))\n;; =\u003e 0    ; R\n;;    255  ; G\n;;    255  ; B\n```\n\nIn the second example, a conversion from CIELAB to quantized RGB, `xyz-to-qrgb` returns a negative R value, which means the color is out of gamut; it is clamped in the third example.\n\nOut of which gamut, however? By default, `xyz-to-qrgb` (and all other RGB converters) regard it as sRGB (D65). You can specify the RGB space explicitly:\n\n```lisp\n(dufy:xyz-to-qrgb 0.37314 0.70144 1.0601 :rgbspace dufy:+srgb+ :clamp nil)  ; sRGB\n;; =\u003e -169\n;;    255\n;;    255\n\n(dufy:xyz-to-qrgb 0.37314 0.70144 1.0601 :rgbspace dufy:+adobe+ :clamp nil) ; Adobe RGB\n;; =\u003e 2\n;;    255\n;;    255\n   \n(dufy:xyz-to-qrgb 0.37314 0.70144 1.0601 :rgbspace dufy:+bg-srgb-10+ :clamp nil) ; bg-sRGB (10 bit)\n;; =\u003e 47\n;;    893\n;;    893\n;; In the Adobe RGB space and bg-sRGB space the color is within gamut.\n```\n\nLikewise most converters regard the implicit illuminant as D65. You can also specify it explicitly:\n\n```lisp\n(dufy:luv-to-xyz 100 0 0)                              ; Illuminant D65 \n(dufy:luv-to-xyz 100 0 0 :illuminant dufy:+illum-d65+) ; Illuminant D65\n;; =\u003e 0.9504692366968726d0\n;;    1.0d0\n;;    1.0889440678362423d0\n;; the white point of standard illuminant D65\n\n(dufy:luv-to-xyz 100 0 0 :illuminant dufy:+illum-e+)   ; Illuminant E\n;; =\u003e 1.0d0\n;;    1.0d0\n;;    1.0000000000000004d0\n```\n\n## Modules\nDufy consists of several independent modules:\n- dufy\n  - dufy/core\n  - dufy/hsluv (HSLuv and HPLuv color spaces)\n  - dufy/munsell (Munsell Color System)\n- dufy/extra-data\n- dufy/examples\n\nSince the main package `dufy` contains slightly large colorimetric data, you may want to load `dufy/core` instead of `dufy` in some cases.\n\nAs of dufy 0.3.0, both the system names and the package names use the separator `/` instead of `-`, though the old package prefixes like `dufy-core` are left as nicknames.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivet-kitty%2Fdufy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprivet-kitty%2Fdufy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivet-kitty%2Fdufy/lists"}