@pbroom/color-kit/reactPerformance
AdaptiveQuality
Return value of useAdaptiveQuality.
import type { AdaptiveQuality } from '@pbroom/color-kit/react';use-adaptive-quality.ts:31interface AdaptiveQuality {
quality: ColorPlaneQualityLevel;
reportFrame: (frame: AdaptiveQualityFrame) => ColorPlaneQualityLevel;
reset: () => void;
}Properties
- quality
ColorPlaneQualityLevel - Current quality level; pass it to the plane hooks'
qualityoption. - reportFrame
(frame: AdaptiveQualityFrame) => ColorPlaneQualityLevel - Records one frame's timing (call it from event handlers, not render) and returns the quality level after adapting. The level drops one step when the rolling average over the last 12 frames is slow and rises one step when it recovers.
- reset
() => void - Clears the rolling timing window, e.g. at the start of a drag.