Repository: ManimCommunity/manim
File: manim/mobject/types/point_cloud_mobject.py (Python)

Code before:
            raise ValueError("points and rgbas must have same length")
        self.rgbas = np.append(self.rgbas, rgbas, axis=0)
        return self

    def set_color(
        self, color: ParsableManimColor = YELLOW, family: bool = True
    ) -> Self:
        rgba = color_to_rgba(color)
        mobs = self.family_members_with_points() if family else [self]
        for mob in mobs:
            mob.rgbas[:, :] = rgba
        self.color = ManimColor.parse(color)
        return self

    def get_stroke_width(self) -> int:
        return self.stroke_width

    def set_stroke_width(self, width: int, family: bool = True) -> Self:
        mobs = self.family_members_with_points() if family else [self]
        for mob in mobs:
            mob.stroke_width = width
        return self

    def set_color_by_gradient(self, *colors: ParsableManimColor) -> Self:
        self.rgbas = np.array(
            map(color_to_rgba, color_gradient_as_list(*colors, len(self.points))),
        )
        return self

    def set_colors_by_radial_gradient(
        self,
        center: Point3DLike | None = None,
        radius: float = 1,
        inner_color: ParsableManimColor = WHITE,
        outer_color: ParsableManimColor = BLACK,
    ) -> Self:
        start_rgba, end_rgba = list(map(color_to_rgba, [inner_color, outer_color]))
        if center is None:
            center = self.get_center()
        for mob in self.family_members_with_points():
            distances = np.abs(self.points - center)
            alphas = np.linalg.norm(distances, axis=1) / radius

            mob.rgbas = np.array(
                np.array(
                    [interpolate(start_rgba, end_rgba, alpha) for alpha in alphas],
                ),
            )
        return self

    def match_colors(self, mobject: Mobject) -> Self:

Review comment (suggestion):
```suggestion
            list(map(color_to_rgba, color_gradient_as_list(*colors, len(self.points)))),
```

Code after:
        return self

    def set_color(
        self, color: ParsableManimColor = YELLOW, family: bool = True
    ) -> Self:
        rgba = color_to_rgba(color)
        mobs = self.family_members_with_points() if family else [self]
        for mob in mobs:
            mob.rgbas[:, :] = rgba
        self.color = ManimColor.parse(color)
        return self

    def get_stroke_width(self) -> int:
        return self.stroke_width

    def set_stroke_width(self, width: int, family: bool = True) -> Self:
        mobs = self.family_members_with_points() if family else [self]
        for mob in mobs:
            mob.stroke_width = width
        return self

    def set_color_by_gradient(self, *colors: ParsableManimColor) -> Self:
        self.rgbas = np.array(
            list(map(color_to_rgba, color_gradient(*colors, len(self.points)))),
        )
        return self

    def set_colors_by_radial_gradient(
        self,
        center: Point3DLike | None = None,
        radius: float = 1,
        inner_color: ParsableManimColor = WHITE,
        outer_color: ParsableManimColor = BLACK,
    ) -> Self:
        start_rgba, end_rgba = list(map(color_to_rgba, [inner_color, outer_color]))
        if center is None:
            center = self.get_center()
        for mob in self.family_members_with_points():
            distances = np.abs(self.points - center)
            alphas = np.linalg.norm(distances, axis=1) / radius

            mob.rgbas = np.array(
                np.array(
                    [interpolate(start_rgba, end_rgba, alpha) for alpha in alphas],
                ),
            )
        return self

    def match_colors(self, mobject: Mobject) -> Self:
        Mobject.align_data(self, mobject)
        self.rgbas = np.array(mobject.rgbas)