# logos

Canonical URL: https://developers.iagenify.com/zh/sdk/ref/brand-object/logos/
Language: zh

`brand.logos.add(logo) · update(id, changes) · setMain(id) · remove(id) · main`

品牌的标志：一个可以像普通数组一样读取的数组，同时也带有修改它的调用。

Status: one main logo · 12 at most · 5 MB each

```javascript
await brand.logos.add({ name: "mark.svg", content: svgText, role: "icon" });
await brand.logos.setMain(brand.logos.find((l) => l.role === "icon").id);
await brand.logos.update(logoId, { role: "monogram" });
await brand.logos.remove(logoId);

brand.logos.main;   // { id, name, role, format, width, height, url, main: true }
```

## 恰好一个主标志 {#main}

第一个标志会成为主标志。删除它时，主标志角色会交给下一个；`setMain()` 可以转移它。没有调色板时，颜色从主标志中提取。

## 角色 {#roles}

`primary`、`secondary`、`icon`、`monogram` 或 `other`。角色说明标志的用途，而不是它的外观。

- [Brand](/zh/sdk/ref/brand-object): 品牌包含什么，以及如何修改它。
- [palette](/zh/sdk/ref/brand-object/palette): 颜色、角色和字体。

```python
brand.logos.add({"name": "mark.svg", "content": svg_text, "role": "icon"})
icon = next(logo for logo in brand.logos if logo["role"] == "icon")
brand.logos.set_main(icon["id"])
brand.logos.update(logo_id, role="monogram")
brand.logos.remove(logo_id)

brand.logos.main   # {"id", "name", "role", "format", "width", "height", "url", "main": True}
```
