import * as React from 'react'; import { Knob } from '../components/Knob'; import { Arc } from '../primitives/Arc'; import { Pointer } from '../primitives/Pointer'; import { Ticks } from '../primitives/Ticks'; import { KnobLabel } from '../primitives/Text'; import { UI_FONT, type SkinProps } from './shared'; export interface MetalKnobProps extends SkinProps { /** Accent color for the active ticks / value arc. */ color?: string; /** Overall metal tone. 'silver' | 'dark' or any base hex for the cap. */ tone?: 'silver' | 'dark'; tickColor?: string; labelColor?: string; indicatorColor?: string; showArc?: boolean; tickCount?: number; } /** 3D brushed-aluminum knob with a knurled rim — classic hi-fi hardware. */ export const MetalKnob: React.FC = ({ size = 90, color = '#4cc2ff', tone = 'silver', tickColor = 'rgba(255,255,255,0.18)', labelColor = 'rgba(255,255,255,0.45)', indicatorColor, showArc = true, tickCount = 21, label, className, style, ...core }) => { const id = React.useId(); const rimId = `${id}-rim`; const faceId = `${id}-face`; const shadowId = `${id}-shadow`; const c = size / 2; const rimR = size / 2 - size * 0.14; const faceR = rimR * 0.78; const silver = tone === 'silver'; const rimStops = silver ? ['#f4f5f7', '#b9bbc2', '#63656d', '#33343a'] : ['#6a6c74', '#43444b', '#232429', '#101114']; const faceStops = silver ? ['#fbfcfd', '#d3d5da', '#9c9ea6'] : ['#585a63', '#33343b', '#1b1c21']; const indicator = indicatorColor ?? (silver ? '#1b1c21' : color); return ( {showArc && ( )} {/* cap */} {/* knurled rim */} {/* concentric machining lines */} {label && ( {label} )} ); };