Reference · The Milky Way: a brightness map and soft bands to draw
MILKY_WAY_NIGHT_RAMPconstant
The package's ramp for a night sky: clear where there is no Milky Way, a faint blue glow, a grey-white band and a warm core, with the opacity rising with the brightness so that the texture can be laid over a dark sky as it is. Made for this package (no photograph's colours were read).
Import it
import { MILKY_WAY_NIGHT_RAMP } from "@johnmorrisdotca/hoshi-stars/milky-way";
Definition
const MILKY_WAY_NIGHT_RAMP: readonly MilkyWayRampStop[] = Object.freeze(([
[0, 0, 0, 0, 0],
[0.08, 106, 128, 200, 0.1],
[0.2, 122, 144, 210, 0.24],
[0.4, 166, 182, 230, 0.4],
[0.65, 232, 228, 232, 0.58],
[1, 255, 243, 216, 0.88],
] as const).map(([level, red, green, blue, alpha]) => Object.freeze({ level, red, green, blue, alpha })))
Examples
import { MILKY_WAY_NIGHT_RAMP } from "@johnmorrisdotca/hoshi-stars/milky-way";
console.log(MILKY_WAY_NIGHT_RAMP.length, MILKY_WAY_NIGHT_RAMP[0]!.alpha); // 6 06 0What it prints (run when this page was built)