Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!panix!not-for-mail From: JohnF Newsgroups: comp.graphics.algorithms Subject: Re: decorative random colors algorithm Date: Wed, 4 Jul 2012 08:01:11 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 58 Message-ID: References: NNTP-Posting-Host: panix3.panix.com X-Trace: reader1.panix.com 1341388871 9499 166.84.1.3 (4 Jul 2012 08:01:11 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 4 Jul 2012 08:01:11 +0000 (UTC) User-Agent: tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (NetBSD/5.1.2 (i386)) Xref: csiph.com comp.graphics.algorithms:916 JohnF wrote: > gernot.hoffmann@hs-emden-leer.de wrote: >> I've added a HLS-page to the doc: >> http://www.fho-emden.de/~hoffmann/swatch22112002.pdf >> It shows RGB-color in HLS coordinates. One graphic per Hue >> 0 to 330 step 30. Horizontally the Saturation and vertically >> the Lightness. These are cylinder coordinates. >> In order to get the double cone appearance, it would be necessary >> to distort the lower half and the upper half linearly so that >> the lines L=0 and L=1 shrink to points. >> The purpose is not to show the double cone, but simply the colors >> which belong to each parameter set H,L,S. > > Thanks, that's nice. After seeing some of those pages, I'm going > to add a "rainbow" ("random" with an "i", and with the d<-->b > reflected about a vertical axis, and the m<-->w about a horizontal > one:) option, so that a sequence of lines will each start with a > fixed h,l,s at one endpoint, and then vary 0 endpoint. So each design will consist of several (the number of its > polygon sides) such rainbow fans. Okay, a (very) preliminary first cut of that is done, with sample at http://www.forkosh.com/decorative4.ps which is certainly not quantitative like your pages, but perhaps as the filename suggests, decorative and maybe a little bit informative. It shows only s=1 and l=1 for 36 h's, repeated three times to form the design. The circle's center is always r,g,b=127,0,127, interpolated out to the circumference at the appropriate h,l,s using your ps code (i.e., anything wrong is entirely your fault:). You can reproduce the design youself, varying the parameters any way you like, as follows. The ps file's %%title is %%Title: ps&example=1&colorseed=999&bezier=0&linewidth1=6&linewidth0=0.5 &fgstart=200&fggstart=0&ngon=3&nsteps=36&hlslmax=1.0&hlssmax=1.0&hue0=0 &hue1=360 which is just the query submitted to the online cgi that anybody can use. So just enter http://www.forkosh.com/cgi-bin/lineart.cgi? into your browser's address window, following the ? with ps&example=1&etc. And your browser should then prompt you to save the postscript file (unless it's already handling postscript with some plugin, or something). You can probably guess what's what: hlslmax and hlssmax from 0.0 to 1.0 are the l and s value, respectively; 0 <= hue0 < hue1 <=360, integers, is the h-range, displayed in nsteps. The circle's fixed center color is controlled by 0<=fgstart<=255, integer, which sets all three r,g,b (grayscale), or fgrstart,fggstart,fgbstart sets them individually (the sample sets fgstart=200&fggstart=0, turning off g). Besides interpolating colors, each line is linewidth0 setlinewidth at the circle's center to linewidth1 setlinewidth at its circumference. bezier and ngon are integers you can play with (they'll affect the design, but not its colors). examples=1 thru 7 are defined, but not all can deal with the new hue0 and hue1 attributes. colorseed does nothing but is a temporary housekeeping necessity. And please always include that leading ps&etc attribute. Thanks again for that ps code, and for all the subsequent discussion, -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )