ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* randomize a color
@ 2006-03-06 15:26 Johan Sandblom
  2006-03-06 15:47 ` Taco Hoekwater
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Sandblom @ 2006-03-06 15:26 UTC (permalink / raw)


The following produces one red square and two black ones, as opposed
to one red and two randomly perturbed but also red ones I was hoping
for. To my poor understanding this usage seems to comply with that
defined in mp-tool.mp. What am I doing wrong.

Regards, Johan

\setupcolors[state=start]
\definecolor[tilered][r=.425, g=0, b=0]
\definecolor[smudge][r=.1, g=.1, b=.1]

\defineoverlay[page][\useMPgraphic{page}]
\setupbackgrounds[page][background=page]

\startuseMPgraphic{page}
fill unitsquare scaled 2cm withcolor \MPcolor{tilered} ;
fill unitsquare
  scaled 2cm
  shifted (2cm,0cm)
  withcolor \MPcolor{tilered} randomized .1 ;
fill unitsquare
  scaled 2cm
  shifted (4cm,0cm)
  withcolor \MPcolor{tilered} randomized \MPcolor{smudge} ;
\stopuseMPgraphic

\starttext

test

\stoptext
--
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
"What is wanted is not the will to believe, but the
will to find out, which is the exact opposite"
- Bertrand Russell

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: randomize a color
  2006-03-06 15:26 randomize a color Johan Sandblom
@ 2006-03-06 15:47 ` Taco Hoekwater
  2006-03-06 16:16   ` Johan Sandblom
  0 siblings, 1 reply; 3+ messages in thread
From: Taco Hoekwater @ 2006-03-06 15:47 UTC (permalink / raw)




Johan Sandblom wrote:
> The following produces one red square and two black ones, as opposed
> to one red and two randomly perturbed but also red ones I was hoping
> for. To my poor understanding this usage seems to comply with that
> defined in mp-tool.mp. What am I doing wrong.

hint: your redpart gets a random value between 0 and 0.0425

Cheers, taco

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: randomize a color
  2006-03-06 15:47 ` Taco Hoekwater
@ 2006-03-06 16:16   ` Johan Sandblom
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Sandblom @ 2006-03-06 16:16 UTC (permalink / raw)
  Cc: mailing list for ConTeXt users

Well, being stupid isn't much fun, you know. One of the few
consolations is bothering knowledgable people with questions that you
are unable to figure out the (albeit obvious) answer to ...

Thank you, Johan

2006/3/6, Taco Hoekwater <taco@elvenkind.com>:
>
>
> Johan Sandblom wrote:
> > The following produces one red square and two black ones, as opposed
> > to one red and two randomly perturbed but also red ones I was hoping
> > for. To my poor understanding this usage seems to comply with that
> > defined in mp-tool.mp. What am I doing wrong.
>
> hint: your redpart gets a random value between 0 and 0.0425
>
> Cheers, taco
>


--
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
"What is wanted is not the will to believe, but the
will to find out, which is the exact opposite"
- Bertrand Russell

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-06 16:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-06 15:26 randomize a color Johan Sandblom
2006-03-06 15:47 ` Taco Hoekwater
2006-03-06 16:16   ` Johan Sandblom

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).