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

Method tint

packages/melonjs/src/video/texture/cache.js:229–243  ·  view source on GitHub ↗

* @ignore

(src, color)

Source from the content-addressed store, hash-verified

227 * @ignore
228 */
229 tint(src, color) {
230 // make sure the src is in the cache
231 let image_cache = this.tinted.get(src);
232
233 if (image_cache === undefined) {
234 image_cache = new Map();
235 this.tinted.set(src, image_cache);
236 }
237
238 if (!image_cache.has(color)) {
239 image_cache.set(color, this.renderer.tint(src, color, "multiply"));
240 }
241
242 return image_cache.get(color);
243 }
244}
245export default TextureCache;

Callers 2

drawImageMethod · 0.45
drawMeshMethod · 0.45

Calls 3

getMethod · 0.65
setMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected