MCPcopy Create free account
hub / github.com/melonjs/melonJS / setColor

Method setColor

packages/melonjs/src/math/color.ts:303–310  ·  view source on GitHub ↗

* Sets the color to the specified values. * @param r - The red component [0 .. 255]. * @param g - The green component [0 .. 255]. * @param b - The blue component [0 .. 255]. * @param [alpha] - The alpha value [0.0 .. 1.0]. Defaults to 1. * @returns Reference to this object for method chain

(r: number = 0, g: number = 0, b: number = 0, alpha = 1.0)

Source from the content-addressed store, hash-verified

301 * @returns Reference to this object for method chaining.
302 */
303 setColor(r: number = 0, g: number = 0, b: number = 0, alpha = 1.0) {
304 this.r = r;
305 this.g = g;
306 this.b = b;
307 this.alpha = alpha;
308
309 return this;
310 }
311
312 /**
313 * Sets the color to the specified normalized float values.

Callers 15

resolveGroupMaterialFunction · 0.95
constructorMethod · 0.95
setHSVMethod · 0.95
setHSLMethod · 0.95
randomMethod · 0.95
parseCSSMethod · 0.95
parseRGBMethod · 0.95
parseHexMethod · 0.95
drawMethod · 0.45
drawRegionMethod · 0.45
drawTriangleMethod · 0.45
drawMethod · 0.45

Calls

no outgoing calls

Tested by 7

paintWithMasksFunction · 0.36
freshAlignmentStateFunction · 0.36
freshLitStateFunction · 0.36
drawWithTintFunction · 0.36
freshFrameFunction · 0.36
drawCutoutMeshFunction · 0.36
drawEmissiveMeshFunction · 0.36