JSON Palette Builder

Zips strings and GH Colors into a JSON dictionary.

JSON Masterplan (Beta) Nickname: MakePalette

Overview

Zips strings and GH Colors into a JSON dictionary.

Inputs (2)

  • Programs (Text): Names of the architectural programs.
  • Colors (Colour): System.Drawing.Color objects from GH Swatches.

Outputs (1)

  • JSON_Palette (Text): Formatted JSON string ready for the OOP Engine.

Method, assumptions and simplifications

The same notes appear in the component's Info output.

Method

  1. Pairs Programs and Colors by index up to the shorter list and writes an indented JSON object mapping each trimmed program name to its RGB triple (0 to 255). Empty names are skipped; a repeated name keeps the last colour.

Assumptions

  • Programs and Colors are in matching order; alpha is dropped.

Simplifications and limits

  • A length mismatch is only flagged in the HUD; the extra items are ignored. The HUD count shows the shorter list length, including skipped empty names.

Workflow

  • Program names and swatches -> JSON_Palette -> JSON masterplan engine components (for example Masses JSON Parser block colours).