Spectroscope
A prism splits a lamp's light into its colours, and every colour is traced through the glass, so turning the table slides the spectrum along the scale. The telescope reads the wavelength where it points and names the line when it lands on one.
What it is for
The honest way to put colour on a site with no brand colour: as a lamp's light, split.
Everything you set here is what the Code and Prompt tabs give you.
Seats open in 11 days. Want one email that morning?
Datasheet
- Mechanism
- Per wavelength ray trace, Cauchy dispersion, Total internal reflection, Minimum deviation, Planck continuum, Emission line lamps, Inverse wavelength reading, Additive light, Room fixed sheen, Sleeping loop, Fit to host
- Stack
- Vanilla ES modules, Canvas 2D, CSS
- Needs
- Nothing, no dependencies
- States
- 11 documented
- Version
- 0.1.0
- Licence
- With a Pass
States
- At restA sodium lamp on, the prism at sodium's minimum deviation, the telescope on the D line reading 589.3 nm; nothing runs.
- Turning the tableDrag the turntable or use its keys: the traced spectrum slides along the scale, slows, stops at minimum deviation and turns back; outside roughly 10° to 29° the light is reflected inside the prism and leaves through the base, every colour together, and the telescope sees nothing.
- Pointing the telescopeDrag its knob along the scale: the porthole pans across the spectrum at ×12 and the display reads the wavelength at the hairline, naming a line when it sits on one.
- Choosing a lampFive keys, a radio group: tungsten is a smooth continuum; sodium, hydrogen, mercury and neon show their own lines at their own wavelengths. Sodium strikes pink on its neon and warms to yellow.
- KeyboardTable ±0.5°, telescope ±0.1° (Shift and Page keys ×10), Home and End; arrows move between lamps; change fires on each key.
- Read-onlyA display: set from code only; aria-readonly says so.
- AluminiumA bead-blasted aluminium frame, light keys, a reflective LCD reading; the breadboard stays black anodised.
- GraphiteA soft-touch graphite frame, dark keys, a glowing VFD reading.
- PhoneThe bench scales as one object; the grips keep their touch targets and turning a grip never scrolls the page.
- Off screen or hiddenIt draws nothing; a lamp warming up finishes when it is back.
- Reduced motionLamps light at once; every reading is the same.
Notes
A hero or a reveal for an optics, imaging, photonics or materials company, a teaching piece for a lab or an education product, and a wavelength input (the telescope is a real slider from 380 to 720 nm, spoken as "589.3 nanometres, sodium D"). Use it in UI for: a hero on an optics or imaging site, a light-source picker (five lamps as a radio group), and a wavelength or colour-temperature slider.
Original. The optics are pure functions in optics.mjs, tested in Node against the textbook minimum-deviation formula. The dispersion is a dense flint's, a little stronger than SF11's, so the visible band spans about fifteen degrees of the scale.
Anatomy
Per wavelength ray trace, Cauchy dispersion, Total internal reflection, Minimum deviation, Planck continuum, Emission line lamps, Inverse wavelength reading, Additive light, Room fixed sheen, Sleeping loop, Fit to host
Usage notes
The honest way to put colour on a site with no brand colour: as a lamp's light, split. Use it in UI for: a hero on an optics or imaging site, a light-source picker (five lamps as a radio group), and a wavelength or colour-temperature slider.
Options
| Option | Type | Description |
|---|---|---|
| lamp | enum | W is a tungsten continuum; Na, H, Hg and Ne are their emission lines. Sodium strikes pink and warms to yellow. |
| prism | number | |
| hairline | number | Where the telescope looks on the scale; the display reads the wavelength there. |
| finish | enum | The frame, keys and display. Auto makes them from the page’s finish (its tokens): pale with an LCD on a light finish, dark with bright cut edges and a VFD on a dark one; without the tokens, aluminium on a light page and graphite on a dark one. The breadboard stays black anodised, so the rays read. |
| light | number | 0 is from above, clockwise. The prism’s edges and the turned table follow it. |
| eyepiece | boolean | |
| size | number | Width (px, 0 = fit) |
| readonly | boolean | A display: values from code only. |
| label | text | Accessible name |
Methods
- wavelength
- reading
- update
- setLamp
- setPrism
- setHairline
- destroy
How it works
Original. The optics are pure functions in optics.mjs, tested in Node against the textbook minimum-deviation formula. The dispersion is a dense flint's, a little stronger than SF11's, so the visible band spans about fifteen degrees of the scale.