Brand

palette

brand.palette.set(colors | { colors, typography }) · role(role) · colors · typography

带角色的颜色,以及字体。设置颜色会替换全部颜色。

PUT /api/brand/:id/palette12 colorscontrast computed
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

await brand.palette.set({
  colors: [{ hex: "#6B3E26", role: "primary", name: "Roast" }, { hex: "#D9A441", role: "accent" }],
  typography: { heading: "Fraunces", body: "Inter", mono: "" },
});

brand.palette.role("primary");
// { hex: "#6B3E26", role: "primary", name: "Roast", cmyk: [...], textColor: "#FFFFFF",
//   contrast: { onWhite: { ratio, level: "AA" }, onBlack: { … } } }
brand.palette.set({
    "colors": [{"hex": "#6B3E26", "role": "primary", "name": "Roast"}, {"hex": "#D9A441", "role": "accent"}],
    "typography": {"heading": "Fraunces", "body": "Inter", "mono": ""},
})

brand.palette.role("primary")
# {"hex": "#6B3E26", "role": "primary", "name": "Roast", "cmyk": [...], "textColor": "#FFFFFF",
#  "contrast": {"onWhite": {"ratio": ..., "level": "AA"}, "onBlack": {...}}}

角色

primary(最多一个)、secondary、accent、neutral、background、text、success、warning 和 error。

字体是一个名称

你的各个界面将使用的字体族名称。展示品牌的界面保留自己的字体:品牌的字体以名称记录,不会为渲染页面而加载。