diff --git a/.github/workflows/CD.yaml b/.github/workflows/CD.yaml index c80da871..4e467787 100644 --- a/.github/workflows/CD.yaml +++ b/.github/workflows/CD.yaml @@ -66,7 +66,7 @@ jobs: targets: ${{ matrix.target }} - name: Install cross if: ${{ matrix.use-cross }} - uses: taiki-e/install-action@v2.42.16 + uses: taiki-e/install-action@v2.44.6 with: tool: cross - name: Cache build artifacts diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml new file mode 100644 index 00000000..d30d954d --- /dev/null +++ b/.github/workflows/mirror.yaml @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: 2024 Shun Sakai +# +# SPDX-License-Identifier: Apache-2.0 OR MIT + +name: Mirror to mirror repositories + +on: + push: + branches: + - "develop" + - "master" + workflow_dispatch: + +jobs: + gitlab: + name: Mirror to GitLab + if: github.actor == 'sorairolake' && github.repository_owner == 'sorairolake' + runs-on: ubuntu-22.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Mirror to GitLab + uses: yesolutions/mirror-action@v0.7.0 + with: + REMOTE: "https://gitlab.com/sorairolake/qrtool.git" + GIT_USERNAME: ${{ github.actor }} + GIT_PASSWORD: ${{ secrets.GITLAB_TOKEN }} + PUSH_ALL_REFS: "false" + + codeberg: + name: Mirror to Codeberg + if: github.actor == 'sorairolake' && github.repository_owner == 'sorairolake' + runs-on: ubuntu-22.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Mirror to Codeberg + uses: yesolutions/mirror-action@v0.7.0 + with: + REMOTE: "https://codeberg.org/sorairolake/qrtool.git" + GIT_USERNAME: ${{ github.actor }} + GIT_PASSWORD: ${{ secrets.CODEBERG_TOKEN }} + PUSH_ALL_REFS: "false" diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index bffca899..11f95e55 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -14,6 +14,12 @@ All notable changes to this project will be documented in this file. The format is based on https://keepachangelog.com/[Keep a Changelog], and this project adheres to https://semver.org/[Semantic Versioning]. +== {compare-url}/v0.11.4\...v0.11.5[0.11.5] - 2024-09-22 + +=== Added + +* Supports `oklab()` and `oklch()` for `--foreground` and `--background` + == {compare-url}/v0.11.3\...v0.11.4[0.11.4] - 2024-08-04 === Changed diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 455a8857..fc8acf5e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,7 +1,9 @@ # Contributor Covenant Code of Conduct @@ -23,23 +25,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or advances of - any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, +- The use of sexualized language or imagery, and sexual attention or advances + of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities @@ -51,23 +53,23 @@ or harmful. Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. +not aligned to this Code of Conduct, and will communicate reasons for +moderation decisions when appropriate. ## Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. +Examples of representing our community include using an official e-mail +address, posting via an official social media account, or acting as an +appointed representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -. -All complaints will be reviewed and investigated promptly and fairly. +. All complaints will be reviewed and investigated +promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. @@ -120,19 +122,16 @@ community. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. +This Code of Conduct is adapted from the [Contributor Covenant], version 2.1, +available at +. Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. +[Mozilla's code of conduct enforcement ladder]. For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations +. Translations are available at +. + +[Contributor Covenant]: https://www.contributor-covenant.org +[Mozilla's code of conduct enforcement ladder]: https://github.com/mozilla/diversity diff --git a/Cargo.lock b/Cargo.lock index 0a84ec48..65ccbb6f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,6 +8,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" version = "0.8.11" @@ -105,31 +111,32 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "assert_cmd" -version = "2.0.15" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc65048dd435533bb1baf2ed9956b9a278fbfdcf90301b39ee117f06c0199d37" +checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d" dependencies = [ "anstyle", "bstr", "doc-comment", + "libc", "predicates", "predicates-core", "predicates-tree", @@ -197,9 +204,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.16.3" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "byteorder-lite" @@ -209,9 +216,12 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cc" -version = "1.1.7" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -221,9 +231,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -231,9 +241,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", @@ -244,9 +254,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.12" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8670053e87c316345e384ca1f3eba3006fc6355ed8b8a1140d104e109e3df34" +checksum = "8937760c3f4c60871870b8c3ee5f9b30771f792a7045c48bcbba999d7d6b3b8e" dependencies = [ "clap", ] @@ -263,14 +273,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.72", + "syn", ] [[package]] @@ -352,9 +362,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "csscolorparser" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb2a7d3066da2de787b7f032c736763eb7ae5d355f81a68bab2675a96008b0bf" +checksum = "46f9a16a848a7fb95dd47ce387ac1ee9a6df879ba784b815537fcd388a1a8288" dependencies = [ "phf", ] @@ -409,7 +419,7 @@ dependencies = [ "flume", "half", "lebe", - "miniz_oxide", + "miniz_oxide 0.7.4", "rayon-core", "smallvec", "zune-inflate", @@ -426,12 +436,12 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.31" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -460,21 +470,21 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "g2gen" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2c7625b2fc250dd90b63f7887a6bb0f7ec1d714c8278415bea2669ef20820e" +checksum = "dc3e32f911a41e073b8492473c3595a043e1369ab319a2dbf8c89b1fea06457c" dependencies = [ "g2poly", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "g2p" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc36d9bdc3d2da057775a9f4fa7d7b09edab3e0eda7a92cc353358fa63b8519e" +checksum = "1a9afa6efed9af3a5a68ba066429c1497c299d4eafbd948fe630df47a8f2d29f" dependencies = [ "g2gen", "g2poly", @@ -482,9 +492,9 @@ dependencies = [ [[package]] name = "g2poly" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af6a86e750338603ea2c14b1c0bfe58cd61f87ca67a0021d9334996024608e12" +checksum = "0fd8b261ccf00df8c5cc60c082bb7d7aa64c33a433cfcc091ca244326c924b2c" [[package]] name = "gif" @@ -555,15 +565,15 @@ dependencies = [ [[package]] name = "imagesize" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" +checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285" [[package]] name = "indexmap" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown", @@ -572,9 +582,9 @@ dependencies = [ [[package]] name = "is-svg" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57672fed95854c46fe7e0c241a325c5d86c4704a746329f888713046c6204705" +checksum = "8e7d694e2d1d2ac8a6566d31fb0806f9e7f67d9f8adb3f188464a7b2f92ab2c0" dependencies = [ "usvg", ] @@ -593,9 +603,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "kurbo" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5aa9f0f96a938266bdb12928a67169e8d22c6a786fda8ed984b85e6ba93c3c" +checksum = "89234b2cc610a7dd927ebde6b41dd1a5d4214cffaef4cf1fb2195d592f92518f" dependencies = [ "arrayvec", "smallvec", @@ -609,24 +619,24 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libdeflate-sys" -version = "1.20.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "669ea17f9257bcb48c09c7ee4bef3957777504acffac557263e20c11001977bc" +checksum = "7b14a6afa4e2e1d343fd793a1c0a7e5857a73a2697c2ff2c98ac00d6c4ecc820" dependencies = [ "cc", ] [[package]] name = "libdeflater" -version = "1.20.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dfd6424f7010ee0a3416f1d796d0450e3ad3ac237a237644f728277c4ded016" +checksum = "a17fe2badabdaf756f620748311e99ef99a5fdd681562dfd343fdb16ed7d4797" dependencies = [ "libdeflate-sys", ] @@ -684,6 +694,15 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "normalize-line-endings" version = "0.3.0" @@ -755,7 +774,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.72", + "syn", ] [[package]] @@ -783,7 +802,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.7.4", ] [[package]] @@ -845,7 +864,7 @@ dependencies = [ [[package]] name = "qrtool" -version = "0.11.4" +version = "0.11.5" dependencies = [ "anstyle", "anstyle-lossy", @@ -875,9 +894,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -954,9 +973,9 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "resvg" -version = "0.42.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "944d052815156ac8fa77eaac055220e95ba0b01fa8887108ca710c03805d9051" +checksum = "c7314563c59c7ce31c18e23ad3dd092c37b928a0fa4e1c0a1a6504351ab411d1" dependencies = [ "log", "pico-args", @@ -968,9 +987,9 @@ dependencies = [ [[package]] name = "rgb" -version = "0.8.45" +version = "0.8.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade4539f42266ded9e755c605bdddf546242b2c961b03b06a7375260788a0523" +checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" dependencies = [ "bytemuck", ] @@ -1006,18 +1025,18 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -1040,24 +1059,30 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "simd-adler32" version = "0.3.7" @@ -1117,9 +1142,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "svgtypes" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fae3064df9b89391c9a76a0425a69d124aee9c5c28455204709e72c39868a43c" +checksum = "794de53cc48eaabeed0ab6a3404a65f40b3e38c067e4435883a65d2aa4ca000e" dependencies = [ "kurbo", "siphasher 1.0.1", @@ -1127,20 +1152,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.109" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -1149,9 +1163,9 @@ dependencies = [ [[package]] name = "sysexits" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4008983d29e823b1415f5f12732d5c9a44059795fb6218262cc0185668851e2" +checksum = "c5649c51a0a23b49261cc66a328925546beaf86d7c9af801b3993732deccec7a" [[package]] name = "tap" @@ -1214,15 +1228,15 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "usvg" -version = "0.42.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84ea542ae85c715f07b082438a4231c3760539d902e11d093847a0b22963032" +checksum = "6803057b5cbb426e9fb8ce2216f3a9b4ca1dd2c705ba3cbebc13006e437735fd" dependencies = [ "base64", "data-url", @@ -1444,7 +1458,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f30fe52a..7639107c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "qrtool" -version = "0.11.4" +version = "0.11.5" authors = ["Shun Sakai "] edition = "2021" rust-version = "1.74.0" @@ -23,22 +23,22 @@ include = ["/LICENSES", "/README.md", "/src"] anstyle = { version = "1.0.8", default-features = false, optional = true } anstyle-lossy = { version = "1.1.2", optional = true } anstyle-yansi = { version = "2.0.1", optional = true } -anyhow = "1.0.86" -clap = { version = "4.5.13", features = ["derive", "wrap_help"] } -clap_complete = "4.5.12" +anyhow = "1.0.89" +clap = { version = "4.5.18", features = ["derive", "wrap_help"] } +clap_complete = "4.5.29" clap_complete_nushell = "4.5.3" -csscolorparser = "0.6.2" +csscolorparser = "0.7.0" image = { version = "0.25.2", default-features = false, features = ["png", "rayon"] } -is-svg = { version = "0.1.1", optional = true } +is-svg = { version = "0.1.2", optional = true } oxipng = { version = "9.1.2", default-features = false, features = ["parallel", "zopfli"], optional = true } qrcode = "0.14.1" -resvg = { version = "0.42.0", default-features = false, optional = true } +resvg = { version = "0.43.0", default-features = false, optional = true } rqrr = "0.7.1" -sysexits = "0.8.1" +sysexits = "0.8.2" yansi = { version = "1.0.1", default-features = false, optional = true } [dev-dependencies] -assert_cmd = "2.0.15" +assert_cmd = "2.0.16" predicates = "3.1.2" [features] diff --git a/README.md b/README.md index 728d7eda..232c8b69 100644 --- a/README.md +++ b/README.md @@ -122,9 +122,10 @@ Generate this image: ### Colored output Use `--foreground` and `--background` options to change the foreground and -background colors of the generated image. These options takes a [CSS color -string] such as `brown`, `#a52a2a` or `rgb(165 42 42)`. The default foreground -color is black and the background color is white of CSS's named colors. +background colors of the generated image. These options takes a +[CSS color string] such as `brown`, `#a52a2a` or `rgb(165 42 42)`. The default +foreground color is black and the background color is white of CSS's named +colors. ```sh qrtool encode --foreground brown --background lightslategray "QR code" > output.png @@ -141,8 +142,9 @@ sequences: qrtool encode -t ansi-true-color --foreground brown --background lightslategray "QR code" ``` -Note that lossy conversion may be performed depending on the color depth -supported by the output format. +Note that lossy conversion may be performed depending on the color space +supported by the method to specify a color, the color depth supported by the +output format, etc. ### Supported input image formats @@ -285,6 +287,16 @@ Please see the following: - [`qrtool-decode(1)`] - [`qrtool-help(1)`] +## Source code + +The upstream repository is available at +. + +The source code is also available at: + +- +- + ## Changelog Please see [CHANGELOG.adoc]. @@ -302,10 +314,10 @@ This program is inspired by [`qrencode`] and [`zbarimg`]. Copyright © 2022–2024 Shun Sakai and other contributors (see [AUTHORS.adoc]) -1. This program is distributed under the terms of either the _Apache License - 2.0_ or the _MIT License_. -2. Some files are distributed under the terms of the _Creative Commons - Attribution 4.0 International Public License_. +1. This program is distributed under the terms of either the _Apache License + 2.0_ or the _MIT License_. +2. Some files are distributed under the terms of the _Creative Commons + Attribution 4.0 International Public License_. This project is compliant with version 3.2 of the [_REUSE Specification_]. See copyright notices of individual files for more details on copyright and diff --git a/docs/book/modules/ROOT/nav.adoc b/docs/book/modules/ROOT/nav.adoc index 075a5982..bba3fe81 100644 --- a/docs/book/modules/ROOT/nav.adoc +++ b/docs/book/modules/ROOT/nav.adoc @@ -13,6 +13,7 @@ * xref:man/man1/qrtool-help.1.adoc[`qrtool-help(1)`] .Resources +* xref:repository.adoc[] * xref:changelog.adoc[] * xref:contributing.adoc[] * xref:authors.adoc[] diff --git a/docs/book/modules/ROOT/pages/repository.adoc b/docs/book/modules/ROOT/pages/repository.adoc new file mode 100644 index 00000000..402397c5 --- /dev/null +++ b/docs/book/modules/ROOT/pages/repository.adoc @@ -0,0 +1,12 @@ +// SPDX-FileCopyrightText: 2024 Shun Sakai +// +// SPDX-License-Identifier: CC-BY-4.0 + += Source Code + +The upstream repository is available at +https://github.com/sorairolake/qrtool.git. + +.The source code is also available at +* https://gitlab.com/sorairolake/qrtool.git +* https://codeberg.org/sorairolake/qrtool.git diff --git a/docs/book/modules/ROOT/pages/usage.adoc b/docs/book/modules/ROOT/pages/usage.adoc index 2467a353..dc33642c 100644 --- a/docs/book/modules/ROOT/pages/usage.adoc +++ b/docs/book/modules/ROOT/pages/usage.adoc @@ -122,7 +122,8 @@ qrtool encode -t ansi-true-color --foreground brown --background lightslategray ---- CAUTION: Note that lossy conversion may be performed depending on the color -depth supported by the output format. +space supported by the method to specify a color, the color depth supported by +the output format, etc. == Supported input image formats diff --git a/docs/man/man1/qrtool-encode.1.adoc b/docs/man/man1/qrtool-encode.1.adoc index f6775aeb..71d22b5e 100644 --- a/docs/man/man1/qrtool-encode.1.adoc +++ b/docs/man/man1/qrtool-encode.1.adoc @@ -4,7 +4,7 @@ = qrtool-encode(1) // Specify in UTC. -:docdate: 2024-08-02 +:docdate: 2024-09-20 :doctype: manpage ifdef::revnumber[:mansource: qrtool {revnumber}] ifndef::revnumber[:mansource: qrtool] @@ -77,6 +77,12 @@ be specified as a value for these options. |HWB function |`hwb(50.6 0% 0%)`, `hwb(0 66.3% 33.7% / 49.8%)` + +|Oklab function +|`oklab(50.4% -0.0906 0.0069)`, `oklab(61.9% -0.0120 -0.0302 / 0.5)` + +|Oklch function +|`oklch(59.41% 0.16 301.29)`, `oklch(61.9% 0.032 248.35 / 49.8%)` |=== This command can also encode the input data in a Micro QR code. This can embed @@ -297,15 +303,17 @@ endif::[] Foreground color. _COLOR_ takes a CSS color string. Colored output is only available when the output format is PNG, SVG or any ANSI escape sequences. - Note that lossy conversion may be performed depending on the color depth - supported by the output format. Default is black. + Note that lossy conversion may be performed depending on the color space + supported by the method to specify a color, the color depth supported by the + output format, etc. Default is black. *--background* _COLOR_:: Background color. _COLOR_ takes a CSS color string. Colored output is only available when the output format is PNG, SVG or any ANSI escape sequences. - Note that lossy conversion may be performed depending on the color depth - supported by the output format. Default is white. + Note that lossy conversion may be performed depending on the color space + supported by the method to specify a color, the color depth supported by the + output format, etc. Default is white. *--verbose*:: diff --git a/package-lock.json b/package-lock.json index 3364a220..bd735223 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1029,9 +1029,9 @@ "license": "BSD-3-Clause" }, "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "license": "MIT", "engines": { @@ -1184,9 +1184,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", "dependencies": { @@ -1522,9 +1522,9 @@ } }, "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", "dev": true, "license": "MIT", "dependencies": { @@ -1676,9 +1676,9 @@ "license": "MIT" }, "node_modules/safe-stable-stringify": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", - "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", "dev": true, "license": "MIT", "engines": { @@ -1791,9 +1791,9 @@ } }, "node_modules/streamx": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.18.0.tgz", - "integrity": "sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ==", + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.20.1.tgz", + "integrity": "sha512-uTa0mU6WUC65iUvzKH4X9hEdvSW7rbPxPtwfWiLMSj3qTdQbAiUboZTxauKfpFuGIGa1C2BYijZ7wgdUXICJhA==", "dev": true, "license": "MIT", "dependencies": { @@ -1839,9 +1839,9 @@ } }, "node_modules/text-decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.1.1.tgz", - "integrity": "sha512-8zll7REEv4GDD3x4/0pW+ppIxSNs7H1J10IKFZsuOMscumCdM2a+toDGLPA3T+1+fLBql4zbt5z83GEQGGV5VA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.0.tgz", + "integrity": "sha512-n1yg1mOj9DNpk3NeZOx7T6jchTbyJS3i3cucbNN6FcdPriMZx7NsgrGpWWdWZZGxD7ES1XB+3uoqHMgOKaN+fg==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -1872,16 +1872,16 @@ } }, "node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true, "license": "0BSD" }, "node_modules/uglify-js": { - "version": "3.19.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.1.tgz", - "integrity": "sha512-y/2wiW+ceTYR2TSSptAhfnEtpLaQ4Ups5zrjB2d3kuVxHj16j/QJwPl5PvuGy9uARb39J0+iKxcRPvtpsx4A4A==", + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", "dev": true, "license": "BSD-2-Clause", "optional": true, diff --git a/src/cli.rs b/src/cli.rs index 0d72543e..3d69263c 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -211,8 +211,9 @@ pub struct Encode { /// /// takes a CSS color string. Colored output is only available when /// the output format is PNG, SVG or any ANSI escape sequences. Note that - /// lossy conversion may be performed depending on the color depth supported - /// by the output format. + /// lossy conversion may be performed depending on the color space supported + /// by the method to specify a color, the color depth supported by the + /// output format, etc. #[arg(long, default_value("black"), value_name("COLOR"))] pub foreground: Color, @@ -220,8 +221,9 @@ pub struct Encode { /// /// takes a CSS color string. Colored output is only available when /// the output format is PNG, SVG or any ANSI escape sequences. Note that - /// lossy conversion may be performed depending on the color depth supported - /// by the output format. + /// lossy conversion may be performed depending on the color space supported + /// by the method to specify a color, the color depth supported by the + /// output format, etc. #[arg(long, default_value("white"), value_name("COLOR"))] pub background: Color, diff --git a/tests/data/colored/hwba.png b/tests/data/colored/hwb_with_alpha.png similarity index 100% rename from tests/data/colored/hwba.png rename to tests/data/colored/hwb_with_alpha.png diff --git a/tests/data/colored/hwba.png.license b/tests/data/colored/hwb_with_alpha.png.license similarity index 100% rename from tests/data/colored/hwba.png.license rename to tests/data/colored/hwb_with_alpha.png.license diff --git a/tests/data/colored/oklab.png b/tests/data/colored/oklab.png new file mode 100644 index 00000000..4282e9ef Binary files /dev/null and b/tests/data/colored/oklab.png differ diff --git a/tests/data/colored/oklab.png.license b/tests/data/colored/oklab.png.license new file mode 100644 index 00000000..df26b1a7 --- /dev/null +++ b/tests/data/colored/oklab.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Shun Sakai + +SPDX-License-Identifier: Apache-2.0 OR MIT diff --git a/tests/data/colored/oklab_with_alpha.png b/tests/data/colored/oklab_with_alpha.png new file mode 100644 index 00000000..1bfc17ff Binary files /dev/null and b/tests/data/colored/oklab_with_alpha.png differ diff --git a/tests/data/colored/oklab_with_alpha.png.license b/tests/data/colored/oklab_with_alpha.png.license new file mode 100644 index 00000000..df26b1a7 --- /dev/null +++ b/tests/data/colored/oklab_with_alpha.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Shun Sakai + +SPDX-License-Identifier: Apache-2.0 OR MIT diff --git a/tests/data/colored/oklch.png b/tests/data/colored/oklch.png new file mode 100644 index 00000000..99c9d676 Binary files /dev/null and b/tests/data/colored/oklch.png differ diff --git a/tests/data/colored/oklch.png.license b/tests/data/colored/oklch.png.license new file mode 100644 index 00000000..df26b1a7 --- /dev/null +++ b/tests/data/colored/oklch.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Shun Sakai + +SPDX-License-Identifier: Apache-2.0 OR MIT diff --git a/tests/data/colored/oklch_with_alpha.png b/tests/data/colored/oklch_with_alpha.png new file mode 100644 index 00000000..a03cf7df Binary files /dev/null and b/tests/data/colored/oklch_with_alpha.png differ diff --git a/tests/data/colored/oklch_with_alpha.png.license b/tests/data/colored/oklch_with_alpha.png.license new file mode 100644 index 00000000..df26b1a7 --- /dev/null +++ b/tests/data/colored/oklch_with_alpha.png.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2024 Shun Sakai + +SPDX-License-Identifier: Apache-2.0 OR MIT diff --git a/tests/encode.rs b/tests/encode.rs index 237ee109..c2b0e7d3 100644 --- a/tests/encode.rs +++ b/tests/encode.rs @@ -2397,7 +2397,7 @@ fn encode_from_hwb_color_with_alpha() { .unwrap(); assert_eq!( image::load_from_memory(&output.stdout).unwrap(), - image::open("tests/data/colored/hwba.png").unwrap() + image::open("tests/data/colored/hwb_with_alpha.png").unwrap() ); assert!(output.status.success()); } @@ -2434,6 +2434,142 @@ fn encode_from_invalid_hwb_bg_color() { .stderr(predicate::str::contains("invalid hwb format")); } +#[test] +fn encode_from_oklab_color() { + let output = utils::command::command() + .arg("encode") + .arg("--foreground") + .arg("oklab(50.4% -0.0906 0.0069)") + .arg("--background") + .arg("oklab(61.9% -0.0120 -0.0302)") + .arg("QR code") + .output() + .unwrap(); + assert_eq!( + DynamicImage::ImageRgb8(image::load_from_memory(&output.stdout).unwrap().to_rgb8()), + image::open("tests/data/colored/oklab.png").unwrap() + ); + assert!(output.status.success()); +} + +#[test] +fn encode_from_oklab_color_with_alpha() { + let output = utils::command::command() + .arg("encode") + .arg("--foreground") + .arg("oklab(50.4% -0.0906 0.0069 / 0.5)") + .arg("--background") + .arg("oklab(61.9% -0.0120 -0.0302 / 0.5)") + .arg("QR code") + .output() + .unwrap(); + assert_eq!( + image::load_from_memory(&output.stdout).unwrap(), + image::open("tests/data/colored/oklab_with_alpha.png").unwrap() + ); + assert!(output.status.success()); +} + +#[test] +fn encode_from_invalid_oklab_fg_color() { + utils::command::command() + .arg("encode") + .arg("--foreground") + .arg("oklab(0)") + .arg("QR code") + .assert() + .failure() + .code(2) + .stderr(predicate::str::contains( + "invalid value 'oklab(0)' for '--foreground '", + )) + .stderr(predicate::str::contains("invalid oklab format")); +} + +#[test] +fn encode_from_invalid_oklab_bg_color() { + utils::command::command() + .arg("encode") + .arg("--background") + .arg("oklab(0)") + .arg("QR code") + .assert() + .failure() + .code(2) + .stderr(predicate::str::contains( + "invalid value 'oklab(0)' for '--background '", + )) + .stderr(predicate::str::contains("invalid oklab format")); +} + +#[test] +fn encode_from_oklch_color() { + let output = utils::command::command() + .arg("encode") + .arg("--foreground") + .arg("oklch(59.41% 0.16 301.29)") + .arg("--background") + .arg("oklch(61.9% 0.032 248.35)") + .arg("QR code") + .output() + .unwrap(); + assert_eq!( + DynamicImage::ImageRgb8(image::load_from_memory(&output.stdout).unwrap().to_rgb8()), + image::open("tests/data/colored/oklch.png").unwrap() + ); + assert!(output.status.success()); +} + +#[test] +fn encode_from_oklch_color_with_alpha() { + let output = utils::command::command() + .arg("encode") + .arg("--foreground") + .arg("oklch(59.41% 0.16 301.29 / 49.8%)") + .arg("--background") + .arg("oklch(61.9% 0.032 248.35 / 49.8%)") + .arg("QR code") + .output() + .unwrap(); + assert_eq!( + image::load_from_memory(&output.stdout).unwrap(), + image::open("tests/data/colored/oklch_with_alpha.png").unwrap() + ); + assert!(output.status.success()); +} + +#[test] +fn encode_from_invalid_oklch_fg_color() { + utils::command::command() + .arg("encode") + .arg("--foreground") + .arg("oklch(0)") + .arg("QR code") + .assert() + .failure() + .code(2) + .stderr(predicate::str::contains( + "invalid value 'oklch(0)' for '--foreground '", + )) + .stderr(predicate::str::contains("invalid oklch format")); +} + +#[test] +fn encode_from_invalid_oklch_bg_color() { + utils::command::command() + .arg("encode") + .arg("--background") + .arg("oklch(0)") + .arg("QR code") + .assert() + .failure() + .code(2) + .stderr(predicate::str::contains( + "invalid value 'oklch(0)' for '--background '", + )) + .stderr(predicate::str::contains("invalid oklch format")); +} + #[test] fn encode_from_invalid_fg_color_function() { utils::command::command()