new GKUtils()

Members


RGBToHex

Description
Converts RGB to Hex color value
Parameters
Name Type Description
r number
g number
b number
Returns
hex representation of RGB color

Methods


<static> radiansForPosition( x, z ) → {number}

Description
Compute axis angles for positon
Parameters
Name Type Description
x number x position
z number z position
Returns

<static> latLonFromWorld( pos ) → {Object}

Description
Convert worldspace [x,y,z] to lat lon
Parameters
Name Type Description
pos Array worldspace coordinates [x,y,z]
Returns

<static> distanceBetweenPoints( p0, p1 )

Description
Computes great circle distance between 2 lat lon coords
Parameters
Name Type Description
p0 Object {lat: ~~, lon: ~~}
p1 Object {lat: ~~, lon: ~~}
Returns

<static> worldFromLatLon( lat, lon, alt ) → {Array}

Description
Convert lat lon alt to worldspace
Parameters
Name Type Description
lat number latitude in degrees
lon number longitude in degrees
alt number altitude from surface of globe in earth radius (surface = 0)
Returns

<static> hexToRGB( h, normalize ) → {Array}

Description
Convert hex color to RGB array
Parameters
Name Type Description
h String Color Hex Code
normalize boolean Should the output be normalized to [0,1]
Returns

<static> hexToRGBA( h, a, normalize ) → {Array}

Description
Convert hex + alpha to RGBA
Parameters
Name Type Description
h String Color hex code
a number Alpha value [0,1]
normalize boolean Should the output be normalized to [0,1]
Returns

<static> lerpColor( a, b, amount ) → {String}

Description
A linear interpolator for hexadecimal colors
Parameters
Name Type Description
a String
b String
amount Number
Returns
Examples
// returns #7F7F7F
			lerpColor('#000000', '#ffffff', 0.5)