MCPcopy Create free account
hub / github.com/BIT-DataLab/Edit-Banana / get_style_for_item

Function get_style_for_item

modules/basic_shape_processor.py:1662–1671  ·  view source on GitHub ↗

获取元素样式,CV检测的强制使用黑色细边框

(item)

Source from the content-addressed store, hash-verified

1660 all_elements_ref = []
1661
1662 def get_style_for_item(item):
1663 """获取元素样式,CV检测的强制使用黑色细边框"""
1664 style = extract_style_specific(image, item["bbox"], item["_type"])
1665 if item.get("_source") == "cv":
1666 style["stroke_width"] = 1
1667 style["stroke_color"] = "#000000"
1668 # 如果detect_rectangles_robust已经提取了填充色,优先使用
1669 if item.get("fill_color"):
1670 style["fill_color"] = item["fill_color"]
1671 return style
1672
1673 for item in containers_list:
1674 item["_style"] = get_style_for_item(item)

Callers 1

process_basic_shapesFunction · 0.85

Calls 1

extract_style_specificFunction · 0.85

Tested by

no test coverage detected