From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/58688 Path: news.gmane.org!not-for-mail From: Marco Newsgroups: gmane.comp.tex.context Subject: Re: How to get randomly coloured text in metapost? Date: Tue, 11 May 2010 21:03:47 +0200 Message-ID: <20100511210347.4ba42220@vorbis> References: <20100511174809.3a52ae89@vorbis> <201005111814.36245.alan.braslau@cea.fr> <20100511193816.58c7c3a4@vorbis> <4BE99C96.1000707@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1273605245 12545 80.91.229.12 (11 May 2010 19:14:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 11 May 2010 19:14:05 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue May 11 21:14:02 2010 connect(): No such file or directory Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OBuu1-0000gn-Jy for gctc-ntg-context-518@m.gmane.org; Tue, 11 May 2010 21:14:01 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 917D5C9B80; Tue, 11 May 2010 21:14:00 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bm1u1dOtVhg1; Tue, 11 May 2010 21:13:57 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D878FC9B91; Tue, 11 May 2010 21:13:57 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2C459C9B91 for ; Tue, 11 May 2010 21:13:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DKoCKbrJtxOv for ; Tue, 11 May 2010 21:13:53 +0200 (CEST) Original-Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by balder.ntg.nl (Postfix) with ESMTP id 096D2C9B80 for ; Tue, 11 May 2010 21:13:52 +0200 (CEST) Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OButp-0000ab-9B for ntg-context@ntg.nl; Tue, 11 May 2010 21:13:49 +0200 Original-Received: from 202.58.85.36 ([202.58.85.36]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 May 2010 21:13:49 +0200 Original-Received: from netuse by 202.58.85.36 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 May 2010 21:13:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory Original-Lines: 34 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 202.58.85.36 X-Newsreader: Claws Mail 3.7.6 (GTK+ 2.20.1; i486-pc-linux-gnu) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:58688 Archived-At: > numeric r, g, b ; > > r := uniformdeviate 1 ; > g := uniformdeviate 1 ; > b := uniformdeviate 1 ; > > textext("\colored[r=" & r & ",g=" & g & ",b=" & b & "]{Test}") Thanks for this snipped, Hans. It looks promising, but I get the following compile error: !mplib : mp terminal: >> "\colored [r=" >> 0.74464 ! Not implemented: (string)&(known numeric). I used the following code: \starttext \startuseMPgraphic {1} numeric r, g, b ; r := uniformdeviate 1 ; g := uniformdeviate 1 ; b := uniformdeviate 1 ; label(textext("\colored[r=" & r & ",g=" & g & ",b=" & b & "]{Test}"), origin); \stopuseMPgraphic \useMPgraphic {1} \stoptext Marco ___________________________________________________________________________________ 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 ___________________________________________________________________________________