文字与标题
逐字上色
一句话随阅读逐字上色:先以浅色淡入,再有一道扫光逐字掠过,字母先闪现强调色,然后定为正常墨色。
安装
npx @imgcli/cli add ink-sweep使用
import { InkSweep } from "@/components/imgcli/ink-sweep";
<InkSweep />默认参数下以 30 fps 渲染 102 帧(3.4 秒),预览画布为 960 × 540。
Use <InkSweep text="Every frame is code you own." /> for 102 frames at 30 fps (INK_SWEEP_SECONDS). sweepSeconds sets the read-along speed; accentColor sets the flash.
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
text | string | "Every frame is code you own." | |
sweepSeconds | number | 1.6 | Seconds the sweep takes from the first letter to the last. |
fontSize | number | 64 | Type size in pixels on a 540px-tall canvas. |
fontWeight | number | 600 | |
maxWidth | number | 0.8 | |
fontFamily | string | — | A face from the Imgcli font list, or any loaded CSS font stack. |
accentColor | string | — | |
theme | Partial<ImgcliTheme> | — | |
mode | "light" | "dark" | — | |
speed | number | 1 |
许可
MIT 许可,可免费用于个人及商业项目,保留版权和许可声明。
Copyright (c) 2026 Ricky (Imgcli) <https://imgcli.com>
常见问题
如何在 Remotion 项目中使用逐字上色?
运行 npx @imgcli/cli add ink-sweep。CLI 会把组件源码复制到项目的 components/imgcli/ 目录并安装依赖,之后可以直接修改源码。
逐字上色能做什么?
一句话随阅读逐字上色:先以浅色淡入,再有一道扫光逐字掠过,字母先闪现强调色,然后定为正常墨色。
使用逐字上色前需要准备什么?
准备 Node.js 20.19 或更高版本,以及一个 Remotion 项目。新项目可以用 npx create-video@latest 创建。免费组件采用 MIT 许可证。