BrushCue Example: Color Rectangle¶

Open In Colab

You can use this tool online at https://www.brushcue.com/tools/color-rectangle

In [ ]:
!pip install brushcue
In [1]:
import brushcue
from PIL import Image
import io

color_profile_srgb_1 = brushcue.color_profile_s_r_g_b()
rgba_color_constant_2 = brushcue.r_g_b_a_color_constant(0.26, 0.56, 0.3, 1)
int_constant_3 = brushcue.int_constant(550)
int_constant_4 = brushcue.int_constant(821)
color_5 = brushcue.r_g_b_a_color_passthrough(rgba_color_constant_2)
vector_2_int_from_components_6 = brushcue.vector2i_from_components(int_constant_3, int_constant_4)
size_7 = brushcue.vector2i_passthrough(vector_2_int_from_components_6)
color_rect_8 = brushcue.composition_color_rect(color_5, color_profile_srgb_1, size_7)

ctx = brushcue.Context()
result = color_rect_8.execute(ctx)
composition = result.as_composition()
data_bytes = composition.to_image_bytes(ctx)
img = Image.open(io.BytesIO(data_bytes))
img.thumbnail((400, 400)) # remove this line for full resolution
img
Out[1]:
No description has been provided for this image