Skip to content

Add gradient text effect#494

Merged
RandyGaul merged 2 commits intoRandyGaul:masterfrom
waldnercharles:cute_draw/add-gradient-text-effect
Mar 10, 2026
Merged

Add gradient text effect#494
RandyGaul merged 2 commits intoRandyGaul:masterfrom
waldnercharles:cute_draw/add-gradient-text-effect

Conversation

@waldnercharles
Copy link
Copy Markdown
Contributor

Text rendering:

  • Added per-corner color support to CF_TextEffect via a colors[4] array and use_colors flag, enabling individual colors for each glyph corner.
  • Implemented the <gradient> text effect, allowing for horizontal, vertical, and per-corner gradients via markup (e.g., <gradient left=#ff0000 right=#0055ff>...</gradient>). Includes logic to blend edge and corner colors and applies them per-glyph.
  • Updated the text rendering pipeline to use per-corner colors when the effect is active, falling back to flat color otherwise.
  • Modified the rendering batch system to pass per-corner colors for text glyphs to the GPU.

Sample:

  • Expanded the text drawing sample to showcase the new gradient and per-corner color features, with several example strings demonstrating different gradient configurations. Also increased the window size.

Other:

  • Fixed a bug in s_parse_color where it would attempt to parse the next field if it starts with valid hex characters.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb46be865c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cute_draw.cpp Outdated
@RandyGaul RandyGaul merged commit 80fca3f into RandyGaul:master Mar 10, 2026
23 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.

2 participants