diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-colorhash.spec | 303 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 305 insertions, 0 deletions
@@ -0,0 +1 @@ +/colorhash-1.2.1.tar.gz diff --git a/python-colorhash.spec b/python-colorhash.spec new file mode 100644 index 0000000..9418b6d --- /dev/null +++ b/python-colorhash.spec @@ -0,0 +1,303 @@ +%global _empty_manifest_terminate_build 0 +Name: python-colorhash +Version: 1.2.1 +Release: 1 +Summary: Generate color based on any object +License: MIT +URL: https://github.com/dimostenis/color-hash-python +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/31/96/bab14a4230c461ce12ee96fc51fc7c893cd803ad700117e042de171a5f82/colorhash-1.2.1.tar.gz +BuildArch: noarch + + +%description +# color-hash + +**Generate a color based on a value** + +This module generates a color based on an object, by calculating a color value +based on a hash value for the object. This means the result is deterministic: +the same value will always result in the same color (so long as the hash +function remains deterministic). + +This module is a port of the [color-hash Javascript library](https://github.com/zenozeng/color-hash). +It supports Python 3.6+. + +## Quick Start + +```python +>>> from colorhash import ColorHash +>>> c = ColorHash('Hello World') +>>> c.hsl +(131, 0.65, 0.5) +>>> c.rgb +(45, 210, 75) +>>> c.hex +'#2dd24b' +``` + +## Installation + +Its hosted on PyPI. + +```bash +pip install colorhash +``` + +## Changelog + +- color-hash 1.2.0 *(2022-10-17)* + - Use typing supporting python3.6 +- color-hash 1.1.0 *(2022-09-01)* + - Add tests + - Add installation instructions +- color-hash 1.0.4 *(2021-11-30)* + - Support only for python 3.6+ + - Add tests +- color-hash 1.0.3 *(2020-12-04)* + - Drop support for python 2 + - Handover of project maintenance +- color-hash 1.0.2 *(2016-07-08)* + - Add ``crc32_hash`` function and set default hashfunc to that. It's not + fully backwards-compatible, but I don't want to bump the version a lot for + not doing my research. +- color-hash 1.0.0 *(2016-07-07)* + - Initial port. + +## License + +Copyright (c) 2016 Felix Krull <f_krull@gmx.de> + +This is a port of the 'color-hash' Javascript library which is: + +Copyright (c) 2015 Zeno Zeng + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +%package -n python3-colorhash +Summary: Generate color based on any object +Provides: python-colorhash +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-colorhash +# color-hash + +**Generate a color based on a value** + +This module generates a color based on an object, by calculating a color value +based on a hash value for the object. This means the result is deterministic: +the same value will always result in the same color (so long as the hash +function remains deterministic). + +This module is a port of the [color-hash Javascript library](https://github.com/zenozeng/color-hash). +It supports Python 3.6+. + +## Quick Start + +```python +>>> from colorhash import ColorHash +>>> c = ColorHash('Hello World') +>>> c.hsl +(131, 0.65, 0.5) +>>> c.rgb +(45, 210, 75) +>>> c.hex +'#2dd24b' +``` + +## Installation + +Its hosted on PyPI. + +```bash +pip install colorhash +``` + +## Changelog + +- color-hash 1.2.0 *(2022-10-17)* + - Use typing supporting python3.6 +- color-hash 1.1.0 *(2022-09-01)* + - Add tests + - Add installation instructions +- color-hash 1.0.4 *(2021-11-30)* + - Support only for python 3.6+ + - Add tests +- color-hash 1.0.3 *(2020-12-04)* + - Drop support for python 2 + - Handover of project maintenance +- color-hash 1.0.2 *(2016-07-08)* + - Add ``crc32_hash`` function and set default hashfunc to that. It's not + fully backwards-compatible, but I don't want to bump the version a lot for + not doing my research. +- color-hash 1.0.0 *(2016-07-07)* + - Initial port. + +## License + +Copyright (c) 2016 Felix Krull <f_krull@gmx.de> + +This is a port of the 'color-hash' Javascript library which is: + +Copyright (c) 2015 Zeno Zeng + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +%package help +Summary: Development documents and examples for colorhash +Provides: python3-colorhash-doc +%description help +# color-hash + +**Generate a color based on a value** + +This module generates a color based on an object, by calculating a color value +based on a hash value for the object. This means the result is deterministic: +the same value will always result in the same color (so long as the hash +function remains deterministic). + +This module is a port of the [color-hash Javascript library](https://github.com/zenozeng/color-hash). +It supports Python 3.6+. + +## Quick Start + +```python +>>> from colorhash import ColorHash +>>> c = ColorHash('Hello World') +>>> c.hsl +(131, 0.65, 0.5) +>>> c.rgb +(45, 210, 75) +>>> c.hex +'#2dd24b' +``` + +## Installation + +Its hosted on PyPI. + +```bash +pip install colorhash +``` + +## Changelog + +- color-hash 1.2.0 *(2022-10-17)* + - Use typing supporting python3.6 +- color-hash 1.1.0 *(2022-09-01)* + - Add tests + - Add installation instructions +- color-hash 1.0.4 *(2021-11-30)* + - Support only for python 3.6+ + - Add tests +- color-hash 1.0.3 *(2020-12-04)* + - Drop support for python 2 + - Handover of project maintenance +- color-hash 1.0.2 *(2016-07-08)* + - Add ``crc32_hash`` function and set default hashfunc to that. It's not + fully backwards-compatible, but I don't want to bump the version a lot for + not doing my research. +- color-hash 1.0.0 *(2016-07-07)* + - Initial port. + +## License + +Copyright (c) 2016 Felix Krull <f_krull@gmx.de> + +This is a port of the 'color-hash' Javascript library which is: + +Copyright (c) 2015 Zeno Zeng + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +%prep +%autosetup -n colorhash-1.2.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-colorhash -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 1.2.1-1 +- Package Spec generated @@ -0,0 +1 @@ +baaed8b46a81b284ff3b367921e378c0 colorhash-1.2.1.tar.gz |
