Overclock.net › Forums › Software, Programming and Coding › Other Software › HOW TO: Invert colors in your browser
New Posts  All Forums:Forum Nav:

HOW TO: Invert colors in your browser

post #1 of 3
Thread Starter 
Ever been in your nice dark room at night and go to read a news site and its background is bright white beaming through your eyes? Hopefully this will help some of you.

So far only tested in Google Chrome but I found this not to long ago and thought I would share it.

The following code can be copy and pasted in your address bar and it "should" invert the colors on your browser window. Funny enough it doesn't work well with OCN. A good site to try on is Engadget.

Code:

javascript:function load_script(src,callback){var s=document.createElement('script');s.src=src;s.onload=callback;document.getElementsByTagName('head')[0].appendChild(s);}function invertColors(){var colorProperties=['color','background-color'];$('*').each(function(){var color=null;for(var prop in colorProperties){prop=colorProperties[prop];if(!$(this).css(prop))continue;color=new RGBColor($(this).css(prop));if(color.ok){$(this).css(prop,'rgb('+(255-color.r)+','+(255-color.g)+','+(255-color.b)+')');}color=null;}});}load_script('http://www.phpied.com/files/rgbcolor/rgbcolor.js',function(){if(!window.jQuery)load_script('https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js',invertColors);else invertColors();}); 

Another useful way to use this code is to make a bookmark and call it "Invert" and paste it in the URL field of the bookmark. Simply clicking on this bookmark performs the invert code listed above.

Cool huh? Give it a try on the Engadget article I linked above.
Shadow
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7920 DO 4.0/1.26V (191x21) Asus P6T MSI Twin Frozr III GTX570 Corsair 6GB DDR3/1600 Mhz 
Hard DriveOSMonitorKeyboard
128GB Falcon SSD / 1TB HDD Win 7 Pro Acer 22" Wide Razor Lycosa 
PowerCaseMouse
Corsair 750w HAF 932 Wolfking Trooper Laser 2400DPI 
  hide details  
Reply
Shadow
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7920 DO 4.0/1.26V (191x21) Asus P6T MSI Twin Frozr III GTX570 Corsair 6GB DDR3/1600 Mhz 
Hard DriveOSMonitorKeyboard
128GB Falcon SSD / 1TB HDD Win 7 Pro Acer 22" Wide Razor Lycosa 
PowerCaseMouse
Corsair 750w HAF 932 Wolfking Trooper Laser 2400DPI 
  hide details  
Reply
post #2 of 3
the text becomes black 0_0
Ivy-E Defined
(17 items)
 
  
CPUMotherboardGraphicsRAM
4930K @ 4.5ghz w/ 1.336v RAMPAGE IV FORMULA GTX 980 Jetstream  G.Skill Ripjaws 16GB 1600mhz 
Hard DriveCoolingOSMonitor
120GB Samsung 840 EVO + 6TB (Storage) Corsair H80i w/ 2 x SP120 Windows 7 Ultimate 64-Bit Asus VG278HE  
KeyboardPowerCaseMouse
Ducky Shine 3 - Brown Cherry MX Switch - Green LED Corsair AX860  Fractal Design Define R4 Black Pearl w/ Window  Razer DeathAdder 2013 
Mouse PadAudioAudioAudio
Overclockers Medium Mouse Mat KRK ROKITS Fiio E10K  Audio Technica ATH-M50 
  hide details  
Reply
Ivy-E Defined
(17 items)
 
  
CPUMotherboardGraphicsRAM
4930K @ 4.5ghz w/ 1.336v RAMPAGE IV FORMULA GTX 980 Jetstream  G.Skill Ripjaws 16GB 1600mhz 
Hard DriveCoolingOSMonitor
120GB Samsung 840 EVO + 6TB (Storage) Corsair H80i w/ 2 x SP120 Windows 7 Ultimate 64-Bit Asus VG278HE  
KeyboardPowerCaseMouse
Ducky Shine 3 - Brown Cherry MX Switch - Green LED Corsair AX860  Fractal Design Define R4 Black Pearl w/ Window  Razer DeathAdder 2013 
Mouse PadAudioAudioAudio
Overclockers Medium Mouse Mat KRK ROKITS Fiio E10K  Audio Technica ATH-M50 
  hide details  
Reply
post #3 of 3
Thanks for sharing! Its quite useful =)
Feed The Dada
(12 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-2600k Asrock Z77e-itx MSI 7970 Samsung 30nm 8GB 
Hard DriveCoolingCoolingOS
Samsung 840 250GB SSD H100 w/ 2x SP120 Antec Kuhler 920 w/ 1x SP120 Linux Ubuntu 10.10 
PowerCaseAudioAudio
Seasonic X650 Bitfenix Prodigy E07K HFI-580 
  hide details  
Reply
Feed The Dada
(12 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-2600k Asrock Z77e-itx MSI 7970 Samsung 30nm 8GB 
Hard DriveCoolingCoolingOS
Samsung 840 250GB SSD H100 w/ 2x SP120 Antec Kuhler 920 w/ 1x SP120 Linux Ubuntu 10.10 
PowerCaseAudioAudio
Seasonic X650 Bitfenix Prodigy E07K HFI-580 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Other Software
Overclock.net › Forums › Software, Programming and Coding › Other Software › HOW TO: Invert colors in your browser