View on GitHub

leaflet-city-mapper

A small 3D rendering engine for leaflet

Colors

Source guide Project README

Parses and converts colors and provides interpolation and formatting helpers.

Color-space boundary

flowchart LR
  RGB["Numeric / CSS / RGB"] --> Parse["parseColor"]
  HSL["Linear-space HSL"] --> Parse
  Parse -->|"HSL conversion"| Output["sRGB components: 0..1"]
  Parse -->|"sRGB inputs"| Output
  Output --> Style["Extrusion / materials"]

CSS strings use the browser parser; CSS alpha is not used for extrusion. Do not convert the resulting sRGB values a second time.

Related: materials, sunlight.