Reference · The Milky Way: a brightness map and soft bands to draw
MilkyWayTexturePixelstype
A painted Milky Way texture.
Import it
import type { MilkyWayTexturePixels } from "@johnmorrisdotca/hoshi-stars/milky-way";
Definition
interface MilkyWayTexturePixels {
width: number;
height: number;
data: Uint8ClampedArray;
}
Members
| Name | Type | Description |
|---|---|---|
width | number | |
height | number | |
data | Uint8ClampedArray<ArrayBufferLike> | Red, green, blue and opacity for each pixel, row by row from the top, as |
Examples
import { milkyWayTexture, type MilkyWayTexturePixels } from "@johnmorrisdotca/hoshi-stars/milky-way";
const texture: MilkyWayTexturePixels = milkyWayTexture({ width: 256 });
console.log(texture.data.length === texture.width * texture.height * 4); // truetrueWhat it prints (run when this page was built)