I am a web designer.
When I browse web sites I like to change some colors and look at how site will appear when I change the primary color.
I do this using "inspect elements". But it is very time consuming work since I need to add lot of codes to change everywhere.
Is there any JavaScript code which I can use to change one color code to another color code using browser console.
Basically what I want to is something like below...
Change #FFF8DC color to #e6dfc6 color everywhere in this site using browser console.


Principle
As Kaiido commented: “
.getComputedStyle()should always return computed values in the formatrgb(nnn, nnn, nnn)orrgba(nnn, nnn, nnn, n)”.So, after looping through all the elements computed styles properties, and replace the applicable color values, there shouldn't be much to do.
My updates
strictas an optional parameter, to be able to avoid the color replacement in values containing multiple colors.Snippet
Of course, you can try the functions on this very page after copy/pasting those in your console. (for example
colorChange("#eff0f1", "#ffaaaa");)