Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

As I know, in ConTeXt stable, one can use \color[gray:3]{} to display the text inside the brackets with a very light gray color, e.g.:

\setupcolor[rgb]
\starttext
    \color[gray:3]{This is some text.}
\stoptext

After upgrading to ConTeXt beta, this no longer works in my document. \color[red]{}, however, does change the text to red.

  • Was the syntax for creating gray colors changed in recent betas?
  • How can I create a range of gray colors (from white to black) using numbers in ConTeXt?
share|improve this question
    
I think we'll need a bit of a clue on versions here –  Joseph Wright Sep 11 '12 at 8:12
    
I have ConTeXt version 2012.08.14. I followed the instructions here: wiki.contextgarden.net/Colors#Choosing_a_color_model –  Village Sep 11 '12 at 8:19
    
What about defining the colour with \definecolor[gray:3][s=.8]? You can also have a look at \definepalet –  Marco Sep 11 '12 at 8:26
    
I can confirm this behavior. Seems to be a regression bug. Please report this to the context mailing list. –  Aditya Sep 11 '12 at 13:25
    
Bug aside, you can iterate through the X11 color definitions to achieve the grayscale gradient: \setupcolor [x11] \dostepwiserecurse{100}{0}{-1}{\color[gray\recurselevel]{foo\space}}. The value determines the percentage of white. –  phg Sep 12 '12 at 15:16

1 Answer 1

up vote 2 down vote accepted

Based on the solution of Philipp Gesang of the context mailing list:

Use \setupcolor[dem] to get scaled colors.

\setupcolor[dem]

\starttext
  \framed[background=color, backgroundcolor=gray:3]{testing}
\stoptext

(I am using background color so that the result is easier to visualize).

share|improve this answer

Your Answer

 
discard

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.