Skip to content

Graphics: shapes, gradients, and SF Symbols - #29

Merged
colemancda merged 7 commits into
masterfrom
feature/graphics
Jul 23, 2026
Merged

Graphics: shapes, gradients, and SF Symbols#29
colemancda merged 7 commits into
masterfrom
feature/graphics

Conversation

@colemancda

Copy link
Copy Markdown
Member

Fourth parity tier: graphics. Adds shape views, linear gradients, and SF Symbol images — the biggest visible gap after text/interaction.

What's new

  • ShapesRectangle, Circle, Capsule, RoundedRectangle(cornerRadius:), each with .fill(Color); emitted as a Shape node the interpreter paints with the matching Compose shape.
  • LinearGradientLinearGradient(colors:startPoint:endPoint:) (and the Gradient form) with UnitPoint; the interpreter picks horizontal/vertical/diagonal from the endpoints and fills available width.
  • Image(systemName:) — a curated SF Symbol → Material icon map (~25 common symbols: star, heart, trash, gear, bell, cart, person…), tinted via .foregroundColor and sized via .frame. Unknown symbols and named assets keep the placeholder text so gaps stay visible.

Verification

  • swift test — 3 new emission tests (shapes/fill/cornerRadius, gradient colors+endpoints, systemName), 44 total passing
  • Emulator (new Graphics screen): all four shapes, horizontal and vertical gradients, and a row of tinted/sized symbols render correctly

Deferred

Ellipse; .stroke; real asset images (no asset pipeline); radial/angular gradients. A shape with only a height (no width) still needs an explicit frame — the fill-the-parent layout behavior isn't modeled (gradients special-case fill-width).

@colemancda
colemancda merged commit a687258 into master Jul 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant