Hello community,
here is the log from the commit of package python-webcolors for
openSUSE:Factory checked in at 2019-09-23 12:17:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-webcolors (Old)
and /work/SRC/openSUSE:Factory/.python-webcolors.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-webcolors"
Mon Sep 23 12:17:57 2019 rev:5 rq:731241 version:1.10
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-webcolors/python-webcolors.changes
2019-06-18 14:54:16.329482478 +0200
+++
/work/SRC/openSUSE:Factory/.python-webcolors.new.7948/python-webcolors.changes
2019-09-23 12:17:58.477801218 +0200
@@ -1,0 +2,7 @@
+Mon Sep 16 10:16:49 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 1.10:
+ * Similar to the change in version 1.9 which normalized conversions to named
+ colors
+
+-------------------------------------------------------------------
Old:
----
webcolors-1.9.1.tar.gz
New:
----
webcolors-1.10.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-webcolors.spec ++++++
--- /var/tmp/diff_new_pack.b1xhMo/_old 2019-09-23 12:17:59.005801131 +0200
+++ /var/tmp/diff_new_pack.b1xhMo/_new 2019-09-23 12:17:59.009801131 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-webcolors
-Version: 1.9.1
+Version: 1.10
Release: 0
Summary: Support for color names and value formats defined by the HTML
License: BSD-3-Clause
++++++ webcolors-1.9.1.tar.gz -> webcolors-1.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/webcolors-1.9.1/PKG-INFO new/webcolors-1.10/PKG-INFO
--- old/webcolors-1.9.1/PKG-INFO 2019-06-08 04:38:58.000000000 +0200
+++ new/webcolors-1.10/PKG-INFO 2019-09-09 08:43:46.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: webcolors
-Version: 1.9.1
+Version: 1.10
Summary: A library for working with color names and color values formats
defined by HTML and CSS.
Home-page: https://github.com/ubernostrum/webcolors
Author: James Bennett
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/webcolors-1.9.1/docs/changelog.rst
new/webcolors-1.10/docs/changelog.rst
--- old/webcolors-1.9.1/docs/changelog.rst 2019-06-08 04:36:44.000000000
+0200
+++ new/webcolors-1.10/docs/changelog.rst 2019-09-09 08:39:00.000000000
+0200
@@ -6,6 +6,24 @@
This document lists the changes between each release of webcolors.
+
+Version 1.10, released 2019-09-08
+---------------------------------
+
+No bug fixes or new features.
+
+Other changes
+~~~~~~~~~~~~~
+
+* Similar to the change in version 1.9 which normalized conversions to
+ named colors for `gray`/`grey` to always use the `gray` variant, the
+ other named grays of CSS3 now normalize to the `gray` spelling. This
+ affects the following colors: `darkgray`/`darkgrey`,
+ `darkslategray`/`darkslategrey`, `dimgray`/`dimgrey`,
+ `lightgray`/`lightgrey`, `lightslategray`/`lightslategrey`,
+ `slategray`/`slategrey`.
+
+
Version 1.9.1, released 2019-06-07
----------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/webcolors-1.9.1/docs/conf.py
new/webcolors-1.10/docs/conf.py
--- old/webcolors-1.9.1/docs/conf.py 2019-06-08 04:35:19.000000000 +0200
+++ new/webcolors-1.10/docs/conf.py 2019-09-09 08:00:21.000000000 +0200
@@ -10,8 +10,8 @@
master_doc = 'index'
project = u'webcolors'
copyright = u'2008-2019, James Bennett'
-version = '1.9'
-release = '1.9.1'
+version = '1.10'
+release = '1.10'
exclude_trees = ['_build']
pygments_style = 'sphinx'
html_static_path = ['_static']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/webcolors-1.9.1/docs/contents.rst
new/webcolors-1.10/docs/contents.rst
--- old/webcolors-1.9.1/docs/contents.rst 2019-06-02 08:04:36.000000000
+0200
+++ new/webcolors-1.10/docs/contents.rst 2019-09-09 08:29:00.000000000
+0200
@@ -202,17 +202,23 @@
.. data:: CSS3_HEX_TO_NAMES
A :class:`dict` whose keys are the normalized hexadecimal values of
- the 147 names CSS3 colors, and whose values are the corresponding
+ the 147 named CSS3 colors, and whose values are the corresponding
normalized names. These colors are also identical to the 147 named
colors of SVG.
.. note:: **Spelling variants**
- CSS3 provides two names -- `gray` and `grey` -- which each map
- to the hexadecimal value `#808080`. Reversing from the
- hexadecimal value to a name requires picking one and only one of
- these, and webcolors chooses `gray` as it was the spelling used
- by HTML 4, CSS1, and CSS2.
+ HTML 4, CSS1, and CSS2 each defined a color named `gray`. In
+ CSS3, this color can be named either `gray` or `grey`, and
+ several other related color values each have two names in CSS3:
+ `darkgray`/`darkgrey`, `darkslategray`/`darkslategrey`,
+ `dimgray`/`dimgrey`, `lightgray`/`lightgrey`,
+ `lightslategray`/`lightslategrey`, `slategray`/`slategrey`.
+
+ Reversing from the hexadecimal value, integer tuple, or percent
+ tuple to a name, for these colors, requires picking one
+ spelling, and webcolors chooses the `gray` spellings for
+ consistency with HTML 4, CSS1, and CSS2.
Normalization functions
@@ -380,7 +386,7 @@
Conversion from hexadecimal color values to other formats
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+---------------------------------------------------------
.. function:: hex_to_name(hex_value, spec=CSS3)
@@ -391,10 +397,11 @@
.. note:: **Spelling variants**
- One hexadecimal value -- `#808080` -- can map to either of two
- names in CSS3, because it supports both `gray` and `grey` as
- color names. This function will return `u'gray'` for the input
- `u'#808080'`. See also the note on :data:`CSS3_HEX_TO_NAMES`.
+ Some values representing named gray colors can map to either of
+ two names in CSS3, because it supports both `gray` and `grey`
+ spelling variants for those colors. This function will always
+ return the variant spelled `gray` (such as `lightgray` instead
+ of `lightgrey`). See also the note on :data:`CSS3_HEX_TO_NAMES`.
Examples:
@@ -476,11 +483,11 @@
.. note:: **Spelling variants**
- One `rgb()` value -- `(128, 128, 128)` -- can map to either of
- two names in CSS3, because it supports both `gray` and `grey` as
- color names. This function will return `u'gray'` for the input
- `(128, 128, 128)`. See also the note on
- :data:`CSS3_HEX_TO_NAMES`.
+ Some values representing named gray colors can map to either of
+ two names in CSS3, because it supports both `gray` and `grey`
+ spelling variants for those colors. This function will always
+ return the variant spelled `gray` (such as `lightgray` instead
+ of `lightgrey`). See also the note on :data:`CSS3_HEX_TO_NAMES`.
Examples:
@@ -566,11 +573,11 @@
.. note:: **Spelling variants**
- One value -- `(50%, 50%, 50%)` -- can map to either of two names
- in CSS3, because it supports both `gray` and `grey` as color
- names. This function will return `u'gray'` for the input
- `(u'50%', u'50%', u'50%')`. See also the note on
- :data:`CSS3_HEX_TO_NAMES`.
+ Some values representing named gray colors can map to either of
+ two names in CSS3, because it supports both `gray` and `grey`
+ spelling variants for those colors. This function will always
+ return the variant spelled `gray` (such as `lightgray` instead
+ of `lightgrey`). See also the note on :data:`CSS3_HEX_TO_NAMES`.
Examples:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/webcolors-1.9.1/docs/faq.rst
new/webcolors-1.10/docs/faq.rst
--- old/webcolors-1.9.1/docs/faq.rst 2019-06-02 08:13:56.000000000 +0200
+++ new/webcolors-1.10/docs/faq.rst 2019-09-09 08:04:11.000000000 +0200
@@ -50,11 +50,16 @@
Why does webcolors prefer American spellings?
---------------------------------------------
-In CSS3, two names -- `gray` and `grey` -- each map to the same color:
-`rgb(128, 128, 128)`. Using any of the conversions from names to other
-formats (:func:`~webcolors.name_to_hex`,
-:func:`~webcolors.name_to_rgb`, or
-:func:`~webcolors.name_to_rgb_percent`) will accept either name
+In CSS3, several color names are defined multiple times with identical
+values, to support both American and British spelling variants for
+`gray`/`grey`. These colors are: `darkgray`/`darkgrey`,
+`darkslategray`/`darkslategrey`, `dimgray`/`dimgrey`, `gray`/`grey`,
+`lightgray`/`lightgrey`, `lightslategray`/`lightslategrey`,
+`slategray`/`slategrey`.
+
+Using any of the conversions from names to other formats
+(:func:`~webcolors.name_to_hex`, :func:`~webcolors.name_to_rgb`, or
+:func:`~webcolors.name_to_rgb_percent`) will accept either spelling
provided the `spec` argument is :data:`~webcolors.CSS3`.
However, converting from other formats to a name requires picking one
@@ -69,17 +74,6 @@
`gray`. This choice was made for consistency with HTML 4, CSS1, and
CSS2, each of which only allowed `gray`.
-As a result, the following functions each return `u'gray'` for the
-following inputs, and never `u'grey'`, even when the `spec` argument
-is :data:`~webcolors.CSS3`:
-
-* :func:`~webcolors.hex_to_name` for input `u'#808080'`
-
-* :func:`~webcolors.rgb_to_name` for input `(128, 128, 128)`
-
-* :func:`~webcolors.rgb_percent_to_name` for input `(u'50%', u'50%',
- u'50%')`
-
Why aren't HSL values supported?
--------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/webcolors-1.9.1/setup.cfg
new/webcolors-1.10/setup.cfg
--- old/webcolors-1.9.1/setup.cfg 2019-06-08 04:38:58.000000000 +0200
+++ new/webcolors-1.10/setup.cfg 2019-09-09 08:43:46.000000000 +0200
@@ -21,7 +21,7 @@
long_description = file: README.rst
name = webcolors
url = https://github.com/ubernostrum/webcolors
-version = 1.9.1
+version = 1.10
[options]
zip_safe = False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/webcolors-1.9.1/src/webcolors.egg-info/PKG-INFO
new/webcolors-1.10/src/webcolors.egg-info/PKG-INFO
--- old/webcolors-1.9.1/src/webcolors.egg-info/PKG-INFO 2019-06-08
04:38:58.000000000 +0200
+++ new/webcolors-1.10/src/webcolors.egg-info/PKG-INFO 2019-09-09
08:43:46.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.2
Name: webcolors
-Version: 1.9.1
+Version: 1.10
Summary: A library for working with color names and color values formats
defined by HTML and CSS.
Home-page: https://github.com/ubernostrum/webcolors
Author: James Bennett
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/webcolors-1.9.1/src/webcolors.py
new/webcolors-1.10/src/webcolors.py
--- old/webcolors-1.9.1/src/webcolors.py 2019-06-08 04:34:51.000000000
+0200
+++ new/webcolors-1.10/src/webcolors.py 2019-09-09 08:00:42.000000000 +0200
@@ -16,7 +16,7 @@
import six
-__version__ = '1.9.1'
+__version__ = '1.10'
def _reversedict(d):
@@ -271,17 +271,26 @@
CSS3_HEX_TO_NAMES = _reversedict(CSS3_NAMES_TO_HEX)
-# Both 'gray' and 'grey' are accepted in CSS3, and both map to the
-# same 24-bit value (#808080). Reversing this requires picking one
-# spelling to be the "winner".
+# CSS3 defines both 'gray' and 'grey', as well as defining either
+# variant for other related colors like 'darkgray'/'darkgrey'. For a
+# 'forward' lookup from name to hex, this is straightforward, but a
+# 'reverse' lookup from hex to name requires picking one spelling.
#
-# The way in which _reversedict generates these mappings will pick a
-# "winner" based on the ordering of dictionary keys, which varies
-# according to the Python version in use, and on some Python versions
-# is deliberately not to be relied on for consistency. So we manually
-# pick one. Since it was the only spelling supported by HTML 4, CSS1,
-# and CSS2, 'gray' is the winner.
+# The way in which _reversedict() generates the reverse mappings will
+# pick a spelling based on the ordering of dictionary keys, which
+# varies according to the version and implementation of Python in use,
+# and in some Python versions is explicitly not to be relied on for
+# consistency. So here we manually pick a single spelling that will
+# consistently be returned. Since 'gray' was the only spelling
+# supported in HTML 4, CSS1, and CSS2, 'gray' and its varients are
+# chosen.
+CSS3_HEX_TO_NAMES[u'#a9a9a9'] = u'darkgray'
+CSS3_HEX_TO_NAMES[u'#2f4f4f'] = u'darkslategray'
+CSS3_HEX_TO_NAMES[u'#696969'] = u'dimgray'
CSS3_HEX_TO_NAMES[u'#808080'] = u'gray'
+CSS3_HEX_TO_NAMES[u'#d3d3d3'] = u'lightgray'
+CSS3_HEX_TO_NAMES[u'#778899'] = u'lightslategray'
+CSS3_HEX_TO_NAMES[u'#708090'] = u'slategray'
# Aliases of the above mappings, for backwards compatibility.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/webcolors-1.9.1/tests/test_conversion.py
new/webcolors-1.10/tests/test_conversion.py
--- old/webcolors-1.9.1/tests/test_conversion.py 2019-05-26
02:15:23.000000000 +0200
+++ new/webcolors-1.10/tests/test_conversion.py 2019-09-09 07:52:46.000000000
+0200
@@ -388,15 +388,35 @@
test cases.
"""
- def test_spelling_variant(self):
+ def test_spelling_variants(self):
"""
When asked to name a color value that maps to either of 'gray' or
- 'grey' in CSS3, webcolors always picks 'gray' as the spelling.
+ 'grey' in CSS3, or a related color like 'darkgray'/'darkgrey',
+ webcolors always picks 'gray' as the spelling.
"""
- for converter, value in (
- (webcolors.hex_to_name, u'#808080'),
- (webcolors.rgb_to_name, (128, 128, 128)),
- (webcolors.rgb_percent_to_name, (u'50%', u'50%', u'50%'))
- ):
- assert u"gray" == converter(value, spec=webcolors.CSS3)
+ test_values = (
+ (u'#a9a9a9', (169, 169, 169),
+ (u'66.27%', u'66.27%', u'66.27%'), u'darkgray'),
+ (u'#2f4f4f', (47, 79, 79),
+ (u'18.43%', u'30.98%', u'30.98%'), u'darkslategray'),
+ (u'#696969', (105, 105, 105),
+ (u'41.18%', u'41.18%', u'41.18%'), u'dimgray'),
+ (u'#808080', (128, 128, 128),
+ (u'50%', u'50%', u'50%'), u'gray'),
+ (u'#d3d3d3', (211, 211, 211),
+ (u'82.75%', u'82.75%', u'82.75%'), u'lightgray'),
+ (u'#d3d3d3', (211, 211, 211),
+ (u'82.75%', u'82.75%', u'82.75%'), u'lightgray'),
+ (u'#778899', (119, 136, 153),
+ (u'46.67%', u'53.33%', u'60.00%'), u'lightslategray'),
+ (u'#708090', (112, 128, 144),
+ (u'43.92%', u'50%', u'56.47%'), u'slategray'),
+ )
+ for hex_value, int_tuple, percent_tuple, name in test_values:
+ for converter, value in (
+ (webcolors.hex_to_name, hex_value),
+ (webcolors.rgb_to_name, int_tuple),
+ (webcolors.rgb_percent_to_name, percent_tuple)
+ ):
+ assert name == converter(value, spec=webcolors.CSS3)