pybricks.parameters.Color: print kwargs in repr
If the __repr__ was previously printing
Color(219, 98, 13)
It now prints
Color(h=219, s=98, v=13)
It evaluates to the same object.
@@ -158,7 +158,7 @@ STATIC mp_obj_t pb_type_Color_make_new(const mp_obj_type_t *type, size_t n_args,
void pb_type_Color_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
pb_type_Color_obj_t *self = MP_OBJ_TO_PTR(self_in);
- mp_printf(print, "Color(%u, %u, %u", self->hsv.h, self->hsv.s, self->hsv.v);
+ mp_printf(print, "Color(h=%u, s=%u, v=%u", self->hsv.h, self->hsv.s, self->hsv.v);
if (self->name != mp_const_none) {
mp_printf(print, ", '%s'", mp_obj_str_get_str(self->name));
}
