geometric-elements

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Geometric Elements Generator

几何元素生成器

Create decorative geometric elements with code using Pixie-python.
使用Pixie-python通过代码生成装饰性几何元素。

Quick Start

快速开始

bash
undefined
bash
undefined

Install dependency (first time only)

安装依赖(仅首次运行)

pip install pixie-python
pip install pixie-python

Generate element (ask user for brand color or check their brand guidelines)

生成元素(请询问用户品牌颜色或查看其品牌规范)

python .claude/skills/geometric-elements/scripts/generate.py corner-accent
--color "#HEX_COLOR"
--size 200
--output media/output/corner.png

**Important:** Always ask user for brand colors or check their brand guidelines skill (e.g., `/thepexcel-brand-guidelines`) before generating.
python .claude/skills/geometric-elements/scripts/generate.py corner-accent
--color "#HEX_COLOR"
--size 200
--output media/output/corner.png

**重要提示:** 生成前请务必询问用户品牌颜色,或查看其品牌规范技能(例如`/thepexcel-brand-guidelines`)。

Available Elements

可用元素

ElementCommandDescription
Basic Shapes
shape
circle, star, heart, hexagon, arrow, etc.
Corner Accent
corner-accent
L-shaped corner decoration
Line Divider
line-divider
Horizontal divider with gradient
Arc Accent
arc-accent
Curved arc
Frame Border
frame-border
4-corner bracket frame
Pattern
pattern
Repeating dots/crosses/diamonds
Mandala
mandala
Sacred geometry / complex patterns
元素命令描述
基础图形
shape
圆形、星形、心形、六边形、箭头等
边角装饰
corner-accent
L形边角装饰
线条分隔符
line-divider
带渐变的水平分隔线
圆弧装饰
arc-accent
弧形线条
边框框架
frame-border
四角支架式边框
重复图案
pattern
重复的圆点/十字/菱形图案
曼陀罗图案
mandala
神圣几何/复杂图案

Common Options

通用选项

OptionDescriptionDefault
--color
Primary color (hex)
#D4A84B
--color2
Secondary color for gradientNone
--size
Element size in pixels200
--width
Canvas width400
--height
Canvas height400
--stroke
Stroke width4
--output
Output file path
output.png
--gradient
linear
or
radial
None
--opacity
0.0-1.01.0
--fill
Fill shape (vs stroke)False
选项描述默认值
--color
主色调(十六进制)
#D4A84B
--color2
渐变次色调
--size
元素尺寸(像素)200
--width
画布宽度400
--height
画布高度400
--stroke
描边宽度4
--output
输出文件路径
output.png
--gradient
渐变类型:
linear
(线性)或
radial
(径向)
--opacity
透明度(0.0-1.0)1.0
--fill
填充图形(替代描边)False

Examples

示例

Basic Shapes

基础图形

bash
undefined
bash
undefined

Circle (stroke)

圆形(描边)

python scripts/generate.py shape --style circle --color "#HEX" --size 100 --stroke 3
python scripts/generate.py shape --style circle --color "#HEX" --size 100 --stroke 3

Star (filled)

星形(填充)

python scripts/generate.py shape --style star --color "#HEX" --size 100 --sides 5 --fill
python scripts/generate.py shape --style star --color "#HEX" --size 100 --sides 5 --fill

Available: circle, ellipse, rectangle, square, rounded-rect, triangle,

可用图形:circle(圆形)、ellipse(椭圆)、rectangle(矩形)、square(正方形)、rounded-rect(圆角矩形)、triangle(三角形)、

polygon, star, diamond, ring, cross, arrow, heart, hexagon, octagon, crescent

polygon(多边形)、star(星形)、diamond(菱形)、ring(环形)、cross(十字)、arrow(箭头)、heart(心形)、hexagon(六边形)、octagon(八边形)、crescent(新月形)

undefined
undefined

Corner Accent

边角装饰

bash
python scripts/generate.py corner-accent --color "#HEX" --size 150 --stroke 4
bash
python scripts/generate.py corner-accent --color "#HEX" --size 150 --stroke 4

Gradient Line Divider

渐变线条分隔符

bash
python scripts/generate.py line-divider --color "#HEX" --color2 "#FFFFFF" --gradient linear --width 800
bash
python scripts/generate.py line-divider --color "#HEX" --color2 "#FFFFFF" --gradient linear --width 800

Mandala (Sacred Geometry)

曼陀罗图案(神圣几何)

bash
python scripts/generate.py mandala --color "#CCC" --bg "#0A0A0A" --size 400 --rings 8 --layers 4 --stroke 1.5
→ More examples: references/element-catalog.md
bash
python scripts/generate.py mandala --color "#CCC" --bg "#0A0A0A" --size 400 --rings 8 --layers 4 --stroke 1.5
→ 更多示例:references/element-catalog.md

Custom Elements (On-the-fly)

自定义元素(即时创建)

For complex patterns not in predefined commands, write Python directly:
python
import pixie
import math

image = pixie.Image(400, 400)
paint = pixie.Paint(pixie.SOLID_PAINT)
paint.color = pixie.Color(0.83, 0.66, 0.29, 1.0)  # RGB 0-1 range

ctx = image.new_context()
ctx.stroke_style = paint
ctx.line_width = 2
ctx.stroke_segment(50, 50, 350, 350)

image.write_file("output.png")
→ Full API: references/pixie-api.md
对于预定义命令中没有的复杂图案,可直接编写Python代码:
python
import pixie
import math

image = pixie.Image(400, 400)
paint = pixie.Paint(pixie.SOLID_PAINT)
paint.color = pixie.Color(0.83, 0.66, 0.29, 1.0)  # RGB 0-1 范围

ctx = image.new_context()
ctx.stroke_style = paint
ctx.line_width = 2
ctx.stroke_segment(50, 50, 350, 350)

image.write_file("output.png")
→ 完整API文档:references/pixie-api.md

From Reference Image

基于参考图片生成

User can send reference images for Claude to analyze and recreate:
  1. User sends image — screenshot, design reference, pattern
  2. Claude analyzes — identifies shapes, colors, proportions
  3. Claude writes code — using pixie-python API
  4. Output — PNG ready to use
Tips for good reference: Clear image, geometric patterns (not photos), specify hex colors if needed.
用户可发送参考图片,由Claude分析并重现:
  1. 用户发送图片 — 截图、设计参考、图案
  2. Claude分析 — 识别形状、颜色、比例
  3. Claude编写代码 — 使用pixie-python API
  4. 输出结果 — 可直接使用的PNG图片
优质参考图提示: 图片清晰、为几何图案(非照片),如有需要可指定十六进制颜色。

Tips

小贴士

  1. Transparent bg — All outputs have transparent background by default
  2. High DPI — Use
    --size
    2x for retina displays
  3. Gradients — Combine
    --gradient linear
    with
    --color
    and
    --color2
  4. Brand colors — Always confirm with user or their brand guidelines first

  1. 透明背景 — 所有输出默认带透明背景
  2. 高DPI适配 — 针对视网膜显示屏,将
    --size
    设为2倍大小
  3. 渐变效果 — 结合
    --gradient linear
    --color
    --color2
    参数使用
  4. 品牌颜色 — 请务必先与用户确认或查看其品牌规范

Related Skills

相关技能

  • /graphic-designer
    — Use elements in graphic designs
  • /thepexcel-brand-guidelines
    — Brand colors for elements
  • /pptx
    — Decorative elements for presentations
  • /graphic-designer
    — 在平面设计中使用这些元素
  • /thepexcel-brand-guidelines
    — 获取元素使用的品牌颜色
  • /pptx
    — 为演示文稿添加装饰元素