mirror of
https://github.com/anomalyco/opentui.git
synced 2026-09-19 01:26:03 +08:00
dd87918e3d
This addresses https://github.com/sst/opentui/issues/184 by defaulting to terminal background if renderer alpha channel is 0. The transparent background can be set by using `renderer.setBackgroundColor("transparent")` for example in `packages/react/examples/basic.tsx`. ```diff import { bold, fg, italic, t, TextAttributes } from "@opentui/core" import { render, useKeyboard, useRenderer } from "@opentui/react" import { useCallback, useState } from "react" export const App = () => { const renderer = useRenderer() + renderer.setBackgroundColor("transparent") const [username, setUsername] = useState("") const [password, setPassword] = useState("") ``` Example in ghostty <img width="852" height="670" alt="image" src="https://github.com/user-attachments/assets/658703ad-77a6-4624-b07c-5a24bbf8447c" /> --------- Co-authored-by: Claude <noreply@anthropic.com>