@luma.gl/shadertools
Version:
Shader module system for luma.gl
23 lines • 1.36 kB
TypeScript
import type { NumberArray3, NumberArray4 } from '@math.gl/types';
/**
* Resolves whether semantic colors should be interpreted as byte-style `0..255` values.
* @param useByteColors - Explicit color interpretation flag.
* @param defaultUseByteColors - Fallback value when `useByteColors` is omitted.
* @returns `true` when semantic colors should be normalized from bytes, otherwise `false`.
*/
export declare function resolveUseByteColors(useByteColors?: boolean, defaultUseByteColors?: boolean): boolean;
/**
* Normalizes an RGB semantic color to float space when byte-style colors are enabled.
* @param color - Input RGB semantic color.
* @param useByteColors - When `true`, divide components by `255`.
* @returns The normalized RGB color.
*/
export declare function normalizeByteColor3(color?: Readonly<NumberArray3>, useByteColors?: boolean): NumberArray3;
/**
* Normalizes an RGBA semantic color to float space when byte-style colors are enabled.
* @param color - Input RGB or RGBA semantic color.
* @param useByteColors - When `true`, divide components by `255`.
* @returns The normalized RGBA color, adding an opaque alpha channel when needed.
*/
export declare function normalizeByteColor4(color: Readonly<NumberArray4> | Readonly<NumberArray3>, useByteColors?: boolean): NumberArray4;
//# sourceMappingURL=normalize-byte-colors.d.ts.map