TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know how to define a light gray color with beamer. I am using this color to shade a small block of my text.

Here is the code I am using for defining my colors.


The current color is giving me a very dark green. I am not sure how to change this to light gray. Can some one help with this ?

Beamer only seems to be accepting values between 0 and 1.

This link does give values for gray but I think it is for some other units. http://www.tayloredmktg.com/rgb/

share|improve this question
Shades of gray consist of equal amounts of r ed, g reen and b lue, so you could use something like \definecolor{shadecolor}{rgb}{0.5,0.5,0.5} or \definecolor{shadecolor}{rgb}{0.8,0.8,0.8}. – Jake Aug 22 '12 at 15:00
Thanks! That was useful – smilingbuddha Aug 22 '12 at 15:17
You can also simply say: \colorlet{shadecolor}{gray!40} (which means 40%gray and 60% white). – Gonzalo Medina Aug 22 '12 at 17:30
up vote 7 down vote accepted

A simple solution would be to use some predefined gray color and the ! syntax together with \colorlet; for example:


(40% gray and 60% white); increasing the value used will produce darker shades and decreasing it, lighter ones.

share|improve this answer

The Link you provided, mentiones the values of RGB (red green blue as mention by @Jake in the comments above) in a range from 0 to 255, i.e. in 8 bit values each. To convert to your needs, divide the values by 256. You can even let beamer to the calcucaltions and use fractions. For example \definecolor{shadecolor}{rgb}{190/256,190/256,190/256} should work as fine as \definecolor{shadecolor}{rgb}{0.7421875,0.7421875,0.7421875} using the values for gray from your link

share|improve this answer
beamer and TikZ use xcolor under the hood so you can directly use integer models via \definecolor{shadecolor}{RGB}{190,190,190} Hex model is also supported. – percusse Aug 22 '12 at 15:54
Oh, i forgot about that, of course; it does. So for integer values colors (0..255) xcolor provides the capital RGB color model and for percental values (0..1) the rgb model. Thanks for the hint. – Ronny Aug 22 '12 at 16:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.