Skip to content

Commit 223f035

Browse files
author
Antonis
committed
format
1 parent 45801dd commit 223f035

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docs/reST/ref/color.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
Creates a Color object from the given Hexadecimal components. Refer to :attr:`Color.hex`
301301
for more information.
302302

303-
.. versionadded:: 2.5.0
303+
.. versionadded:: 2.5.5
304304

305305
.. ## Color.from_hex ##
306306

src_c/color.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ static PyMethodDef _color_methods[] = {
241241
DOC_COLOR_FROMI1I2I3},
242242
{"from_normalized", (PyCFunction)_color_from_normalized,
243243
METH_CLASS | METH_VARARGS, DOC_COLOR_FROMNORMALIZED},
244-
{"from_hex", (PyCFunction)_color_from_hex,
245-
METH_CLASS | METH_VARARGS, DOC_COLOR_FROMHEX},
244+
{"from_hex", (PyCFunction)_color_from_hex, METH_CLASS | METH_VARARGS,
245+
DOC_COLOR_FROMHEX},
246246
{"normalize", (PyCFunction)_color_normalize, METH_NOARGS,
247247
DOC_COLOR_NORMALIZE},
248248
{"correct_gamma", (PyCFunction)_color_correct_gamma, METH_VARARGS,

test/color_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,11 +855,11 @@ def test_from_hex(self):
855855

856856
self.assertEqual(expected_hex, hex)
857857

858+
self.assertRaises(ValueError, lambda: pygame.Color.from_hex("not-a-color"))
858859
self.assertRaises(
859-
ValueError, lambda: pygame.Color.from_hex("not-a-color")
860+
ValueError, lambda: pygame.Color.from_hex("not-a-color", "lel")
860861
)
861862

862-
863863
def test_normalize(self):
864864
c = pygame.Color(204, 38, 194, 55)
865865
self.assertEqual(c.r, 204)

0 commit comments

Comments
 (0)