MCPcopy
hub / github.com/KilledByAPixel/LittleJS / rgbaInt

Method rgbaInt

src/engineMath.js:1088–1095  ·  view source on GitHub ↗

Returns this color expressed as 32 bit RGBA value * @return {number}

()

Source from the content-addressed store, hash-verified

1086 /** Returns this color expressed as 32 bit RGBA value
1087 * @return {number} */
1088 rgbaInt()
1089 {
1090 const r = clamp(this.r)*255|0;
1091 const g = clamp(this.g)*255<<8;
1092 const b = clamp(this.b)*255<<16;
1093 const a = clamp(this.a)*255<<24;
1094 return r + g + b + a;
1095 }
1096
1097 /** Checks if this is a valid color
1098 * @return {boolean} */

Callers 7

math.test.mjsFile · 0.80
drawTileFunction · 0.80
drawRectGradientFunction · 0.80
drawTextureWrappedFunction · 0.80
drawLineListFunction · 0.80
drawPolyFunction · 0.80
drawEllipseGradientFunction · 0.80

Calls 1

clampFunction · 0.85

Tested by

no test coverage detected