MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / draw_badge

Function draw_badge

experiments/human_eval/draw_error_analysis_figure.py:178–190  ·  view source on GitHub ↗
(
    draw: ImageDraw.ImageDraw,
    x: int,
    y: int,
    label: str,
    color: tuple[int, int, int],
    text_color: tuple[int, int, int] = TEXT,
)

Source from the content-addressed store, hash-verified

176
177
178def draw_badge(
179 draw: ImageDraw.ImageDraw,
180 x: int,
181 y: int,
182 label: str,
183 color: tuple[int, int, int],
184 text_color: tuple[int, int, int] = TEXT,
185) -> None:
186 tw, _ = text_box(draw, label, F_TAG)
187 w = tw + 42
188 h = 43
189 draw.rounded_rectangle((x, y, x + w, y + h), radius=7, fill=color)
190 draw_centered(draw, (x + w / 2, y + h / 2 + 1), label, F_TAG, text_color)
191
192
193def draw_card(

Callers 1

draw_cardFunction · 0.85

Calls 2

text_boxFunction · 0.85
draw_centeredFunction · 0.85

Tested by

no test coverage detected