question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setLayers and Image Color Change

See original GitHub issue

I am trying to change the color of an image

canvas.setLayers('layerName', {
   soruce: lay.soruce,
   rotate:10,
}, function(layer) {
   $(this).setPixels({
      x: layer.x, y: layer.y,
      width: layer.width, height: layer.height,
      each: function(px) {
         px.r = 255 - px.r;
         px.g = 255 - px.g;
         px.b = 255 - px.b;
         }
    });
}).drawLayers();

does not seem by firing? I think I am doing this wrong… any help would be appreciated.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ubergeekzonecommented, Aug 9, 2017

got it! thanks!

1reaction
ubergeekzonecommented, Aug 8, 2017

Beautiful, Works like a charm!!! Thank you!! One last thing.

Could you explain how this works to me. What if I wanted to replace the color of an image rather than tint it?

each: function(px) {
   px.r = 255 - px.r;
   px.g = 255 - px.g;
   px.b = 255 - px.b;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Change Color in Parts of an Image in Adobe ...
Before changing the color, duplicate the layer by going to the Layers Panel , right-clicking (PC) / Ctrl -clicking (Mac) on the layer,...
Read more >
Advanced techniques for changing the color of an object
Learn how to match a color onto any object in Adobe Photoshop. Use the power of ... Apply any color to a product...
Read more >
How To Change The Color Of Any Layer In Photoshop
Learn how to easily change the color of a layer in Photoshop whether you're working with image layers, text layers, shape layers, and...
Read more >
PyQGIS: Render (Print/Save) a Layer as an Image
First get the map setting from QGIS, and set the background color to be the same as the background color for the painter....
Read more >
Change Layers Panel background color in QGIS
In QGIS it's easy to change background color of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found