import { Random } from "best-random" ; export const rnd = new Random ( ( Math . random ( ) * 0x100000000 ) | 0 ) ; export function randomColor ( ) { const channel = ( ) => ( 32 + ( rnd . float64 ( ) * 196 ) | 0 ) . toString ( 16 ) . padStart ( 2 , "0" ) ; return `#${ channel ( ) }${ channel ( ) }${ channel ( ) }` ; } export function normal ( ) { for ( ; ; ) { const u = 2 * rnd . float64 ( ) - 1 ; const v = 2 * rnd . float64 ( ) - 1 ; const r = u * u + v * v ; if ( 0 <= r && r <= 1 ) { return u * Math . sqrt ( - 2 * Math . log ( r ) / r ) ; } } }