ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Consistent Colors
Date: Tue, 29 Jan 2013 18:10:35 +0100	[thread overview]
Message-ID: <C8BA5017-48E6-4075-A3E3-30BA03B9FB04@gmail.com> (raw)
In-Reply-To: <51078438.5080009@gmail.com>


Am 29.01.2013 um 09:11 schrieb Devendra Ghate <devendra.ghate@gmail.com>:

> I have been going through the concepts underlying pallet.
> 
> I would like to define three basic colors in RGB. Then use various shades
> and tints of these basic three colors through out the document.
> 
> Now the algorithm for getting various shades for RGB scheme is:
> 
> Darker shades:
> Multiply each component by 1/4, 1/2, 3/4, etc.
> of its previous value, depending on how dark the
> color should be.
> 
> Lighter tints:
> Calculate (1 - previous value), multiply that by
> 1/4, 1/2, 3/4, etc. and add that to the previous value.
> 
> What I would like is a macro that is fed a color name
> and should define 3 shades above and below it.

\definecolor[test-0][r=0.8,g=0.2,b=0.4]

\definecolor[test-1][1.00(test-0)]
\definecolor[test-2][0.75(test-0)]
\definecolor[test-3][0.50(test-0)]
\definecolor[test-4][0.25(test-0)]

\starttext
\startlines
\color[test-1]{1.00}
\color[test-2]{0.75}
\color[test-3]{0.50}
\color[test-4]{0.25}
\stoplines
\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


      parent reply	other threads:[~2013-01-29 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29  8:11 Devendra Ghate
2013-01-29 16:02 ` Devendra Ghate
2013-01-29 17:10 ` Wolfgang Schuster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C8BA5017-48E6-4075-A3E3-30BA03B9FB04@gmail.com \
    --to=wolfgang.schuster@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).