@pbroom/color-kit/driverColor area

getColorAreaKeyAxis

Axis a color-area key acts on, or null when the key is not handled: ArrowLeft/ArrowRight/Home/End act on x, ArrowUp/ArrowDown/PageUp/PageDown on y.

functionimport { getColorAreaKeyAxis } from '@pbroom/color-kit/driver';color-area.ts:741
function getColorAreaKeyAxis(  key: string,): 'x' | 'y' | null;

Parameters

keystring

Returns

'x' | 'y' | null

Example

TypeScript
import { getColorAreaKeyAxis } from '@pbroom/color-kit/driver';

getColorAreaKeyAxis('ArrowUp'); // → 'y'
getColorAreaKeyAxis('Home'); // → 'x'
getColorAreaKeyAxis('Enter'); // → null