mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 02:35:22 +08:00
Preliminary script wrapper implemented and applied to moser/main.py, more moser/main.py functions as well
This commit is contained in:
@ -22,9 +22,9 @@ def get_pixels(image_array):
|
||||
|
||||
def paint_region(region, image_array = None, color = None):
|
||||
pixels = get_pixels(image_array)
|
||||
# assert region.shape == pixels.shape[:2]
|
||||
assert region.shape == pixels.shape[:2]
|
||||
if color is None:
|
||||
rgb = np.random.random(3)
|
||||
rgb = 0.5 * np.random.random(3) #Random darker colors
|
||||
else:
|
||||
rgb = np.array(Color(color).get_rgb())
|
||||
pixels[region.bool_grid] = (255*rgb).astype('uint8')
|
||||
|
Reference in New Issue
Block a user