Reference · The Milky Way: a brightness map and soft bands to draw
MilkyWayTextureOptionstype
What texture to paint.
Import it
import type { MilkyWayTextureOptions } from "@johnmorrisdotca/hoshi-stars/milky-way";
Definition
interface MilkyWayTextureOptions extends MilkyWayDetailOptions {
width?: number;
frame?: "equatorial" | "galactic";
ramp?: readonly MilkyWayRampStop[];
}
Members
| Name | Type | Description |
|---|---|---|
width (optional) | number | undefined | Pixels across: an even whole number from 16 to 4096 (the family's largest texture side), default 2048. The height is half of it. |
frame (optional) | "galactic" | "equatorial" | undefined |
|
ramp (optional) | readonly MilkyWayRampStop[] | undefined | The colours, at least two stops in rising order of level, the first at 0 and the last at 1. Default |
detail (optional) | number | undefined | 0 reads the grid in straight lines between its points (the default for |
Examples
import { milkyWayTexture, type MilkyWayTextureOptions } from "@johnmorrisdotca/hoshi-stars/milky-way";
const options: MilkyWayTextureOptions = { width: 1024, frame: "galactic", detail: 1.5 };
console.log(milkyWayTexture(options).height); // 512512What it prints (run when this page was built)