|
1 | 1 | import { BoxRenderable, MouseButton, MouseEvent, RGBA, TextAttributes } from "@opentui/core" |
| 2 | +import { useRenderer } from "@opentui/solid" |
2 | 3 | import { For, createMemo, createSignal, onCleanup, onMount, type JSX } from "solid-js" |
3 | 4 | import { useTheme, tint } from "@tui/context/theme" |
4 | 5 | import * as Sound from "@tui/util/sound" |
@@ -554,6 +555,7 @@ function buildIdleState(t: number, ctx: LogoContext): IdleState { |
554 | 555 | export function Logo(props: { shape?: LogoShape; ink?: RGBA; idle?: boolean } = {}) { |
555 | 556 | const ctx = props.shape ? build(props.shape) : DEFAULT |
556 | 557 | const { theme } = useTheme() |
| 558 | + const renderer = useRenderer() |
557 | 559 | const [rings, setRings] = createSignal<Ring[]>([]) |
558 | 560 | const [hold, setHold] = createSignal<Hold>() |
559 | 561 | const [release, setRelease] = createSignal<Release>() |
@@ -684,6 +686,7 @@ export function Logo(props: { shape?: LogoShape; ink?: RGBA; idle?: boolean } = |
684 | 686 | }) |
685 | 687 |
|
686 | 688 | const idleState = createMemo(() => (props.idle ? buildIdleState(frame().t, ctx) : undefined)) |
| 689 | + const useSubpixelBlocks = () => renderer.capabilities?.rgb === true |
687 | 690 |
|
688 | 691 | const renderLine = ( |
689 | 692 | line: string, |
@@ -789,7 +792,7 @@ export function Logo(props: { shape?: LogoShape; ink?: RGBA; idle?: boolean } = |
789 | 792 | } |
790 | 793 |
|
791 | 794 | // Solid █: render as ▀ so the top pixel (fg) and bottom pixel (bg) can carry independent shimmer values |
792 | | - if (char === "█") { |
| 795 | + if (char === "█" && useSubpixelBlocks()) { |
793 | 796 | return ( |
794 | 797 | <text |
795 | 798 | fg={shade(inkTop, theme, n + p + e + b)} |
|
0 commit comments