Palette Swatch Row Position

Place an explicit palette swatch index on a row-major grid with physical size and gaps; no renderer or color-space behavior.

Description

Place an explicit palette swatch index on a row-major grid with physical size and gaps; no renderer or color-space behavior.

A palette swatch grid maps a linear entry index to row, column and top-left position. Gaps contribute to each repeated pitch.

When to use this tool

Place an explicit palette swatch index on a row-major grid with physical size and gaps; no renderer or color-space behavior.

  • Prepare the supplied index, columns, swatchWidth, swatchHeight, gapX, gapY fields for this operation.
  • Compare the complete example with the representation used by your own input before carrying the result into another step.

How to use the tool and how it works

  1. Enter index, columns, swatchWidth, swatchHeight, gapX, gapY. Use the exact text syntax, units and index conventions explained below.
  2. Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
  3. Read result.row, result.column, result.x, result.y. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.

Require a nonnegative integer index, columns 1 to 128, positive swatch dimensions and nonnegative gaps. row is floor(index/columns), column is index modulo columns, and coordinates multiply those positions by swatch extent plus gap.1

Input fieldMeaning and representationAccepted input
indexindex.Integer from 0 to 1e9 inclusive
columnscolumns.Integer from 1 to 128 inclusive
swatchWidthswatch width.Finite number; greater than zero
swatchHeightswatch height.Finite number; greater than zero
gapXgap x.Finite number
gapYgap y.Finite number
Output fieldInterpretation
resultObject containing the named outputs below.
result.rowThe row value under the stated formula or text convention.
result.columnThe column value under the stated formula or text convention.
result.xThe x value under the stated formula or text convention.
result.yThe y value under the stated formula or text convention.
json
{
  "input": {
    "index": 5,
    "columns": 3,
    "swatchWidth": 10,
    "swatchHeight": 8,
    "gapX": 2,
    "gapY": 1
  },
  "output": {
    "result": {
      "row": 1,
      "column": 2,
      "x": 24,
      "y": 9
    }
  }
}

Limitations and assumptions

  • The origin is zero and units follow the dimensions supplied. No palette entries, rendered page or container fit are inspected.
  • Palette records contain string id/name and exactly four RGBA bytes from zero through 255; at most 128 records are accepted. Duplicate IDs or names remain allowed unless this operation explicitly audits or rejects them.
  • Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
  • Lists are limited to 128 entries. JSON text must meet bounded size and depth checks, and numeric outputs beyond the safe finite magnitude are rejected. Exact large integers use decimal strings.
  • Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.

Alternative or Complementary methods

Use actual rendering or a color-managed workflow when comparing perceived color and transparency. Index changes need corresponding updates to their consumers; name and role checks do not establish visual accessibility.

References

  1. Tool behavior and example: Palette Swatch Row Position — tool.io

Similar or alternative tools

  • Palette Adjacent Repeat Audit

    Audit adjacent exact RGBA palette repeats, excluding RGB-only matches whose alpha differs; caller ordering is preserved.

  • Palette Alpha Presence Summary

    Count transparent, opaque and partially transparent RGBA palette byte entries; no compositing or color-space conversion.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies