AI 跟练的素材生产工具,产物写入 TUICallKit-Vue3/training: - 教练动作帧:AI 设定稿 → 切帧对齐、锁脸、插帧 → 导出小程序帧与 COS 高清帧 - 示范视频:Remotion 渲染四个动作的示范视频 - 背景音乐:程序合成的原创循环音乐(npm run bgm)
23 lines
827 B
TypeScript
23 lines
827 B
TypeScript
export const FONT = '"PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif'
|
|
export const INK = '#0f172a'
|
|
export const MUTED = '#64748b'
|
|
|
|
function parse(hex: string): [number, number, number] {
|
|
const h = hex.replace('#', '')
|
|
return [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16)) as [number, number, number]
|
|
}
|
|
|
|
function toHex(rgb: number[]): string {
|
|
return '#' + rgb.map((v) => Math.round(Math.max(0, Math.min(255, v))).toString(16).padStart(2, '0')).join('')
|
|
}
|
|
|
|
/** 与白色混合,amount 越大越浅 */
|
|
export function tint(hex: string, amount: number): string {
|
|
return toHex(parse(hex).map((v) => v + (255 - v) * amount))
|
|
}
|
|
|
|
/** 与黑色混合,amount 越大越深 */
|
|
export function darken(hex: string, amount: number): string {
|
|
return toHex(parse(hex).map((v) => v * (1 - amount)))
|
|
}
|