Standard Toolkit
Packages@accelint/converters

Overview

A lightweight JavaScript utility for converting between various value types, including colors, booleans, numbers, geographic coordinates, and map tile coordinates.

Installation

pnpm add @accelint/converters

Usage

// Import from root (all exports)
import { 
  hexToRgba255Tuple, 
  rgba255TupleToHex,
  booleanToNumber,
  toBoolean 
} from '@accelint/converters';

// Import from sub-modules
import { hexToRgba255Tuple } from '@accelint/converters/hex';
import { cssRgbaStringToRgba255Tuple } from '@accelint/converters/css-rgba';
import { glslToRgba255Tuple } from '@accelint/converters/glsl';

Available Exports

Export PathDescription
boolean-to-numberConvert boolean values to numeric representations (0/1)
css-rgbaConvert between CSS rgba strings/objects and RGBA 0-255 tuples
glslConvert between GLSL normalized colors (0-1) and RGBA 0-255 tuples
hexConvert between hex color strings and RGBA 0-255 tuples
to-booleanConvert various value types to boolean
zxy-to-bboxConvert map tile coordinates (z/x/y) to bounding box coordinates

On this page