A screen ruler is indispensable for a programmer who works with images, windows or the web. KDE Screen Ruler is the best screen ruler I have used. It can show the ruler in vertical or horizontal orientations, ruler opacity is configurable and it has a RGB color picker value that is always displayed on it.
Installing it is easy:
$ sudo apt install kruler
Note that if you do not have any KDE application installed, installing this one may pull in many KDE packages to be installed. This is not a problem for me, since I do use some KDE applications.
Tried with: KDE Screen Ruler 4.13.0 and Ubuntu 14.04