[PR #111] [CLOSED] fix: improve nested buffer alpha blending and fix ascii background bug #296

Closed
opened 2026-03-02 23:45:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/111
Author: @KurtGokhan
Created: 8/31/2025
Status: Closed

Base: mainHead: fix-nested-buffer-alpha-blending


📝 Commits (7)

  • 157741b fix ascii buffer not rendering with transparent background
  • b813675 better alpha blending for background colors
  • 7404ea9 improve alpha blending for bg mode
  • f007acf improve example
  • 32dbf21 fix format
  • 479fcc8 add nested buffer example
  • 3d0241b format fix

📊 Changes

2 files changed (+143 additions, -30 deletions)

View changed files

📝 packages/core/src/examples/framebuffer-demo.ts (+108 -11)
📝 packages/core/src/zig/buffer.zig (+35 -19)

📄 Description

Noticed that the background of ASCII characters weren't preserved when rendered inside a framebuffer. Made some changes to skip rendering invisible foreground and background colors.

While working on that I had to also change the blending algorithm for background colors, as it was also causing subtle issues with ASCII fonts. It can be seen in the videos below, where before the overlay text bg looks more frosted, whereas in the after video it's more actual color blending. Maybe we can add color blending modes in the future to leave the preference to the user.

Before:

https://github.com/user-attachments/assets/a8fe7c1c-8e44-4e7f-9baa-9e30fac2eecd

After:

https://github.com/user-attachments/assets/ef942023-fdad-4824-abd2-6471008a9fbb


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/111 **Author:** [@KurtGokhan](https://github.com/KurtGokhan) **Created:** 8/31/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-nested-buffer-alpha-blending` --- ### 📝 Commits (7) - [`157741b`](https://github.com/anomalyco/opentui/commit/157741be50e13aa323f578eac4caeb6be99a06bf) fix ascii buffer not rendering with transparent background - [`b813675`](https://github.com/anomalyco/opentui/commit/b813675628a1839636d862766dd591a6ee38a4b3) better alpha blending for background colors - [`7404ea9`](https://github.com/anomalyco/opentui/commit/7404ea96329b77f810f292a8248b8086309250c1) improve alpha blending for bg mode - [`f007acf`](https://github.com/anomalyco/opentui/commit/f007acf9f3aa80a5d814c6383708eea674fc2988) improve example - [`32dbf21`](https://github.com/anomalyco/opentui/commit/32dbf210899e88c6134dcac2ab469cd71219bcae) fix format - [`479fcc8`](https://github.com/anomalyco/opentui/commit/479fcc89990b7ca6ab5ac12f6d4735296489b54d) add nested buffer example - [`3d0241b`](https://github.com/anomalyco/opentui/commit/3d0241bcc050723df46268df8706568e547eaa76) format fix ### 📊 Changes **2 files changed** (+143 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/examples/framebuffer-demo.ts` (+108 -11) 📝 `packages/core/src/zig/buffer.zig` (+35 -19) </details> ### 📄 Description Noticed that the background of ASCII characters weren't preserved when rendered inside a framebuffer. Made some changes to skip rendering invisible foreground and background colors. While working on that I had to also change the blending algorithm for background colors, as it was also causing subtle issues with ASCII fonts. It can be seen in the videos below, where before the overlay text bg looks more frosted, whereas in the after video it's more actual color blending. Maybe we can add color blending modes in the future to leave the preference to the user. Before: https://github.com/user-attachments/assets/a8fe7c1c-8e44-4e7f-9baa-9e30fac2eecd After: https://github.com/user-attachments/assets/ef942023-fdad-4824-abd2-6471008a9fbb --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:45:50 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#296
No description provided.