Skip to content

Commit d88361c

Browse files
authored
Merge pull request #5295 from lesamouraipourpre/patch-3
Documentation update for ColorConverter
2 parents 3508b01 + a1e4105 commit d88361c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

shared-bindings/displayio/ColorConverter.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ STATIC mp_obj_t displayio_colorconverter_obj_convert(mp_obj_t self_in, mp_obj_t
8686
MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_convert_obj, displayio_colorconverter_obj_convert);
8787

8888
//| dither: bool
89-
//| """When true the color converter dithers the output by adding random noise when
89+
//| """When `True` the ColorConverter dithers the output by adding random noise when
9090
//| truncating to display bitdepth"""
9191
//|
9292
STATIC mp_obj_t displayio_colorconverter_obj_get_dither(mp_obj_t self_in) {
@@ -111,8 +111,11 @@ const mp_obj_property_t displayio_colorconverter_dither_obj = {
111111
MP_ROM_NONE},
112112
};
113113

114-
//| def make_transparent(self, pixel: int) -> None:
115-
//| """Sets a pixel to not opaque."""
114+
//| def make_transparent(self, color: int) -> None:
115+
//| """Set the transparent color or index for the ColorConverter. This will
116+
//| raise an Exception if there is already a selected transparent index.
117+
//|
118+
//| :param int color: The color to be transparent"""
116119
//|
117120
STATIC mp_obj_t displayio_colorconverter_make_transparent(mp_obj_t self_in, mp_obj_t transparent_color_obj) {
118121
displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in);
@@ -123,8 +126,10 @@ STATIC mp_obj_t displayio_colorconverter_make_transparent(mp_obj_t self_in, mp_o
123126
}
124127
MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_make_transparent_obj, displayio_colorconverter_make_transparent);
125128

126-
//| def make_opaque(self, pixel: int) -> None:
127-
//| """Sets a pixel to opaque."""
129+
//| def make_opaque(self, color: int) -> None:
130+
//| """Make the ColorConverter be opaque and have no transparent pixels.
131+
//|
132+
//| :param int color: [IGNORED] Use any value"""
128133
//|
129134
STATIC mp_obj_t displayio_colorconverter_make_opaque(mp_obj_t self_in, mp_obj_t transparent_color_obj) {
130135
displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in);

0 commit comments

Comments
 (0)