From 596410289a18a94e98541a28e50347a8a995d103 Mon Sep 17 00:00:00 2001 From: Ruth Comer <10599679+rcomer@users.noreply.github.com> Date: Mon, 15 Jun 2026 12:57:37 +0100 Subject: [PATCH] DOC: clarify valid inputs and return type of same_color --- lib/matplotlib/colors.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index 53471e0f0a17..bb3c65a9df03 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -288,7 +288,15 @@ def same_color(c1, c2): """ Return whether the colors *c1* and *c2* are the same. - *c1*, *c2* can be single colors or lists/arrays of colors. + Parameters + ---------- + c1, c2 : :mpltype:`color` or list of :mpltype:`color` or RGB(A) array + Must be convertible to an (n, 4) RGBA array, where n is the same for + *c1* and *c2*. + + Returns + ------- + bool """ c1 = to_rgba_array(c1) c2 = to_rgba_array(c2)