[NTG-context] colors for links
Hi Hans, I have the following source, which tries to resemble three kinds of links: \setupinteraction[state=start, style=, focus=standard] \def\inone#1{% \start\setupinteraction[color=darkgreen]% \enabledirectives[references.border=darkgreen]% \goto{#1}[url(#1)]\stop} \def\intwo#1{% \start\setupinteraction[color=darkred]% \enabledirectives[references.border=darkred]% \goto{#1}[url(#1)]\stop} \def\inthree#1{% \start\setupinteraction[color=darkblue]% \enabledirectives[references.border=darkblue]% \goto{#1}[url(#1)]\stop} \starttext \startTEXpage[offset=1dk, align=middle] \inone{one}\blank \intwo{two}\blank \inthree{three}\blank \stopTEXpage \chapter[one]{First chapter} \chapter[two]{Second chapter} \chapter[three]{Second chapter} \stoptext I see that the directive for link borders only allows one color for links per document. In my real-world documents, I need to make three different border links: for destinations inside the document (/GoTo), for destinations in other documents (/GoToR or /GoToE) and for external destinations (/URI). With the current document I write now, I have over a hundred links in twenty pages. Being able to visually distinguish each link helps interaction with the document (reading or even writing it). Would it be possible that \setupinteraction could have a bordercolor key, such as the color one? Many thanks for your help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
Re: [NTG-context] colors and contours in luametafun
On 6/20/2022 6:29 PM, Jacob Kauffmann via ntg-context wrote: Dear list, Am 01.09.2021 um 09:54 schrieb Jacob Kauffmann via ntg-context : - color by value in lmt_surface We want to show a surface plot of a function where the color indicates the function value (instead, or in addition to a light source). The easiest would be to have variable cf for the brightness factor (as it is), and in addition variables such as zt, minz, maxz, akin to the color formatter for lmt_contour. This becomes handy when colors are to be aligned with function values (e.g. negative = blue, zero = white, positive = red, see MWE attached). I managed to achieve this by tweaking f_color and mp.lmt_surface_do in mlib-cnt.lmt in ConTeXt ver: 2022.05.11 11:36 LMTX fmt: 2022.6.20 a bit. Please find the diff and a MWE attached. in next version (next time just send me the file, easier than a diff) Cheers, Jacob Kauffmann --- context/tex/texmf-context/tex/context/base/mkxl/mlib-cnt.lmt 2022-06-20 18:11:51.0 +0200 +++ mlib-cnt.lmt2022-06-20 18:26:22.0 +0200 @@ -1839,7 +1839,29 @@ local f_color = formatters [ [[ local math = math -return function(f) +local min = math.min +local max = math.max +local abs = math.abs +local minz = %s +local maxz = %s + +local color_value = 0 +local color_step = mp.lmt_color_functions.step +local color_shade = mp.lmt_color_functions.shade + +local function step(...) +return color_step(color_value,n,...) +end +local function shade(...) +return color_shade(color_value,n,...) +end +-- local function lin(l) +-- return l/n +-- end +%s +return function(z, f) +function_value = z +brightness_factor = f return %s end ]] ] @@ -1898,7 +1920,7 @@ local dy = (ymax - ymin) / ny local xt = xmin -- -local minf, maxf +local minf, maxf, minz, maxz -- -- similar as contours but no data loop here -- @@ -1908,12 +1930,6 @@ return false -- fatal error end -- -local ccode = load(f_color(colorcode)) -local color = type(ccode) == "function" and ccode() -if type(color) ~= "function" then -return false -- fatal error -end --- for i=0,nx do local yt = ymin for j=0,ny do @@ -1946,7 +1962,16 @@ maxf = fac end -- -data[i][j] = { x, y, fac } +if not minz then + minz = z + maxz = z +elseif z < minz then + minz = z +elseif z > maxz then + maxz = z +end +-- +data[i][j] = { x, y, fac, z } -- yt = yt + dy end @@ -1957,6 +1982,16 @@ local range = maxf - minf local cl = linecolor or 1 local enforce = attributes.colors.model == "cmyk" +-- +-- local ccode = load(f_color(colorcode)) +report("minz, maxz is (%s,%s)",minz,maxz) +report("colorcode is %s", colorcode) +local ccode = load(f_color(minz, maxz, preamble, colorcode)) +local color = type(ccode) == "function" and ccode() +if type(color) ~= "function" then +return false -- fatal error +end +-- for i=0,nx-1 do for j=0,ny-1 do -- points @@ -1985,12 +2020,13 @@ local z32 = z3[2] local z41 = z4[1] local z42 = z4[2] +local zout = z1[4] -- if lines then -- -- fill first and draw then, previous shapes can be covered -- else -- -- fill and draw in one go to prevent artifacts -- end -local cr, cg, cb = color(cf) +local cr, cg, cb = color(zout, cf) if not cr then cr = 0 end if not cg then cg = 0 end if not cb then cb = 0 end ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the
Re: [NTG-context] colors and contours in luametafun
Dear list, > Am 01.09.2021 um 09:54 schrieb Jacob Kauffmann via ntg-context > : > - color by value in lmt_surface > We want to show a surface plot of a function where the color indicates the > function value (instead, or in addition to a light source). > The easiest would be to have variable cf for the brightness factor (as it > is), and in addition variables such as zt, minz, maxz, akin to the color > formatter for lmt_contour. > This becomes handy when colors are to be aligned with function values (e.g. > negative = blue, zero = white, positive = red, see MWE attached). I managed to achieve this by tweaking f_color and mp.lmt_surface_do in mlib-cnt.lmt in ConTeXt ver: 2022.05.11 11:36 LMTX fmt: 2022.6.20 a bit. Please find the diff and a MWE attached. Cheers, Jacob Kauffmann --- context/tex/texmf-context/tex/context/base/mkxl/mlib-cnt.lmt 2022-06-20 18:11:51.0 +0200 +++ mlib-cnt.lmt2022-06-20 18:26:22.0 +0200 @@ -1839,7 +1839,29 @@ local f_color = formatters [ [[ local math = math -return function(f) +local min = math.min +local max = math.max +local abs = math.abs +local minz = %s +local maxz = %s + +local color_value = 0 +local color_step = mp.lmt_color_functions.step +local color_shade = mp.lmt_color_functions.shade + +local function step(...) +return color_step(color_value,n,...) +end +local function shade(...) +return color_shade(color_value,n,...) +end +-- local function lin(l) +-- return l/n +-- end +%s +return function(z, f) +function_value = z +brightness_factor = f return %s end ]] ] @@ -1898,7 +1920,7 @@ local dy = (ymax - ymin) / ny local xt = xmin -- -local minf, maxf +local minf, maxf, minz, maxz -- -- similar as contours but no data loop here -- @@ -1908,12 +1930,6 @@ return false -- fatal error end -- -local ccode = load(f_color(colorcode)) -local color = type(ccode) == "function" and ccode() -if type(color) ~= "function" then -return false -- fatal error -end --- for i=0,nx do local yt = ymin for j=0,ny do @@ -1946,7 +1962,16 @@ maxf = fac end -- -data[i][j] = { x, y, fac } +if not minz then + minz = z + maxz = z +elseif z < minz then + minz = z +elseif z > maxz then + maxz = z +end +-- +data[i][j] = { x, y, fac, z } -- yt = yt + dy end @@ -1957,6 +1982,16 @@ local range = maxf - minf local cl = linecolor or 1 local enforce = attributes.colors.model == "cmyk" +-- +-- local ccode = load(f_color(colorcode)) +report("minz, maxz is (%s,%s)",minz,maxz) +report("colorcode is %s", colorcode) +local ccode = load(f_color(minz, maxz, preamble, colorcode)) +local color = type(ccode) == "function" and ccode() +if type(color) ~= "function" then +return false -- fatal error +end +-- for i=0,nx-1 do for j=0,ny-1 do -- points @@ -1985,12 +2020,13 @@ local z32 = z3[2] local z41 = z4[1] local z42 = z4[2] +local zout = z1[4] -- if lines then -- -- fill first and draw then, previous shapes can be covered -- else -- -- fill and draw in one go to prevent artifacts -- end -local cr, cg, cb = color(cf) +local cr, cg, cb = color(zout, cf) if not cr then cr = 0 end if not cg then cg = 0 end if not cb then cb = 0 end colors_and_surface_in_luametafun.pdf Description: Adobe PDF document colors_and_surface_in_luametafun.tex Description: Binary data signature.asc Description: Message signed with OpenPGP ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] colors and contours in luametafun
Dear list, I am a huge fan of the new metafun interface. Hans asked for luametafun requests, so here are a few. - color by value in lmt_surface We want to show a surface plot of a function where the color indicates the function value (instead, or in addition to a light source). The easiest would be to have variable cf for the brightness factor (as it is), and in addition variables such as zt, minz, maxz, akin to the color formatter for lmt_contour. This becomes handy when colors are to be aligned with function values (e.g. negative = blue, zero = white, positive = red, see MWE attached). - controlling line levels in lmt_contour It would be convenient if certain levels could be set by the user. E.g. to make sure the zero level contour line is included. The user interface could potentially take a list, levels = { -1, -.5, 0, .5, 1 }, of contour level lines. See MWE attached. From my understanding marching squares can do that. A possible reference implementation could be QuadContourGenerator [1] in matplotlib, a bit of description can be found in [2]. - colormaps Contour plots often use rather complex colormaps, such as jet, rainbow or veridis. They are optimized for perceptual resolution, color blindness, screen/print or certain use cases. The functionality is already there, but from a user's perspective, it would be much easier if some of these were provided by the interface. The interface could be color = "colormap('jet')(l/n)". Indeed, these are useful in other use cases as well, such as bar charts, surface plots or shades. One rudimentary example is in the attached file. - number of levels in lmt_contour (potential bug) The number of levels is different from the user's input. Depending on the output range it can be lower or higher (see MWE attached). Cheers, Jacob Kauffmann [1] https://github.com/matplotlib/matplotlib/blob/96ff1146ad053c5c7481efd9de039c879a595968/src/_contour.cpp [2] https://github.com/matplotlib/matplotlib/blob/96ff1146ad053c5c7481efd9de039c879a595968/src/_contour.h colors_and_contours_in_luametafun.tex Description: Binary data colors_and_contours_in_luametafun.pdf Description: Adobe PDF document ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Colors in lmt_surface and luametafun
On 4/17/2020 3:33 PM, Otared Kavian wrote: Hi Hans, On page 36 of luametafun.pdf there is the following example of using lmt_surface: \startMPcode{doublefun} draw lmt_surface [ preamble = "local sin, cos = math.sin, math.cos", code = "sin(x*x) - cos(y*y)", color = "f, f/2, 1-f", color = "f, f, 0", xstep = .02, ystep = .02, xvector = {-0.4, -0.4}, height = 10cm, lines = true, ] xsized .TextWidth ; \stopMPcode What is the meaning of « f » in « color = "f, f/5, 1-f" »? Is it possible to specify other colors and how can it be done? f = fraction you can write some function yourself \starttext \startMPcode{doublefun} draw lmt_surface [ preamble = "local sin, cos = math.sin, math.cos", code = "sin(x*x) - cos(y*y)", color= "f, f, 0", xstep= .02, ystep= .02, xvector = {-0.4, -0.4}, height = 5cm, lines= true, ] ysized (TextHeight/4) ; \stopMPcode \startluacode function MyColor(f) return f/2, f/3, .5 end \stopluacode \startMPcode{doublefun} draw lmt_surface [ preamble = "local sin, cos = math.sin, math.cos", code = "sin(x*x) - cos(y*y)", color= "MyColor(f)", xstep= .02, ystep= .02, xvector = {-0.4, -0.4}, height = 5cm, lines= true, ] ysized (TextHeight/4) ; \stopMPcode \startMPcode{doublefun} draw lmt_surface [ preamble = "local sin, cos = math.sin, math.cos " & "function MyColor(f) return 0, f/3, .5 end", code = "sin(x*x) - cos(y*y)", color= "MyColor(f)", xstep= .02, ystep= .02, xvector = {-0.4, -0.4}, height = 5cm, lines= true, ] ysized (TextHeight/4) ; \stopMPcode - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Colors in lmt_surface and luametafun
Hi Hans, On page 36 of luametafun.pdf there is the following example of using lmt_surface: \startMPcode{doublefun} draw lmt_surface [ preamble = "local sin, cos = math.sin, math.cos", code = "sin(x*x) - cos(y*y)", color = "f, f/2, 1-f", color = "f, f, 0", xstep = .02, ystep = .02, xvector = {-0.4, -0.4}, height = 10cm, lines = true, ] xsized .TextWidth ; \stopMPcode What is the meaning of « f » in « color = "f, f/5, 1-f" »? Is it possible to specify other colors and how can it be done? Thanks for your attention: Otared ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors in MetaPost
On 9/11/2019 2:18 PM, Henning Hraban Ramm wrote: Am 2019-09-11 um 13:46 schrieb Henning Hraban Ramm : \definecolor[VerlaufVon][c=75,m=5,y=95,k=60] \definecolor[VerlaufNach][c=88,m=95,y=5,k=60] Of course I need values between 0 and 1. Sorry for the noise. I think I’m too tired... there is an alternative interface on top of the existing one (coming) ... % maybe handy: definecolor [ name = "MyColor3", r = 0.22, g = 0.44, b = 0.66 ] ; definecolor [ name = "MyColor4", r = 0.66, g = 0.44, b = 0.22 ] ; % parameter driven: draw lmt_shade [ path = fullcircle scaled 4cm, direction = "right", domain= { 0, 2 }, colors= { "MyColor3", "MyColor4" }, ] ; but tweaking shades will never be easy Hans (working in the metafun xl manual, more soon) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors in MetaPost
Am 2019-09-11 um 13:46 schrieb Henning Hraban Ramm : > \definecolor[VerlaufVon][c=75,m=5,y=95,k=60] > \definecolor[VerlaufNach][c=88,m=95,y=5,k=60] Of course I need values between 0 and 1. Sorry for the noise. I think I’m too tired... Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] colors in MetaPost
Hi, I’m trying to get a linear shade in the background of my presentation. But it seems like MetaPost can’t handle my self-defined colors: \definecolor[VerlaufVon][c=75,m=5,y=95,k=60] \definecolor[VerlaufNach][c=88,m=95,y=5,k=60] \startuniqueMPgraphic{Verlauf} % old method, also doesn’t work % path p ; % p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; % linear_shade(p,6,\MPcolor{VerlaufVon},\MPcolor{VerlaufNach}) ; fill fullsquare xyscaled (\overlaywidth,\overlayheight) withshademethod "linear" withshadevector (0.5,2.5) %withshadedirection shadedup withshadecolors ("VerlaufVon", "VerlaufNach") ; \stopuniqueMPgraphic \defineoverlay[verlaufen][\useMPgraphic{Verlauf}] \setupbackgrounds[paper][background={verlaufen}] \starttext \strut \stoptext The background consists of a blue and a green area instead of a shade. While testing I sometimes got a few more stripes in the top and bottom area, can’t reproduce any more. I also tried RGB and hex (HTML) definitions. Predefined colors work. According to the MetaFun manual, either \MPcolor{name} or just "name" should work. What’s wrong? Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Colors not showing inside metapost after \showcolor
I have texlive 2016 on windows OS, I use context mkiv. with context -- version I have: current version: 2016-05-17 ___ 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 ___
Re: [NTG-context] Colors not showing inside metapost after \showcolor
On 7/23/2016 9:35 AM, Schmitz Thomas A. wrote: On 23 Jul 2016, at 09:24, Bou Salimwrote: Hi I have this problem to show colors properly. I have defined color "myred", but after \showcolor command colors inside metapost can't be displayed. Your example shows the correct colors here. Which version are you using? mkii or mkiv? we can even say this now: fill fullcircle scaled 10mm withcolor "myred"; to refer to colors at the context end Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] Colors not showing inside metapost after \showcolor
> On 23 Jul 2016, at 09:24, Bou Salimwrote: > > Hi > I have this problem to show colors properly. I have defined color "myred", > but after \showcolor command colors inside metapost can't be displayed. Your example shows the correct colors here. Which version are you using? mkii or mkiv? Thomas ___ 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 ___
[NTG-context] Colors not showing inside metapost after \showcolor
Hi I have this problem to show colors properly. I have defined color "myred", but after \showcolor command colors inside metapost can't be displayed. Thanks \starttext \definecolor[myred] [r=.8] \showcolor \startuseMPgraphic{test} fill fullcircle scaled 10mm withcolor \MPcolor{myred}; \stopuseMPgraphic \midaligned{\useMPgraphic{test}} \stoptext ___ 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 ___
Re: [NTG-context] Colors: printing vs. on screen
Thanks! I'll go for the calibration and some trials in CMYK colors for printing. kind regards Erik 2011/6/19 Henning Hraban Ramm hra...@fiee.net Yes, because your monitor uses RGB and your printer uses CMYK. The conversion between thetwo is not too complicated, but actually getting the same output from the two is hard. RGB is an additive model, CMYK is subtractive (read about the different models, wikipedia will do). The color impression you get by looking at the output is generated in completely different ways. Most office printers cope well with RGB (sRGB) colors, a lot of inkjet printers even better than with CMYK colors, because they're optimized for home dummy use. But (as Christoph pointed out) your printer can be as great as it goes, you'll never get a similar color impression if your monitor's set to some extreme setting - and most monitors that I saw outside of the graphical branch are set to nonsense settings, e.g. max contrast. Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer) __**__** ___ 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 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/http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net __**__** ___ ___ 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 ___
[NTG-context] Colors: printing vs. on screen
Dear List, I defined the following color for one of my documents: \definecolor[P][r=0.64,g=0.22,b=0.27] When I printed this document on a probably typical office laser printer (a Canon iRC), the colors didn't match. (not even close and I didn't like the printed color) This is probably no real surprise, but can anybody provide some insight or hints to information on these matters to me: -- Are spot colors the thing to use to get a grip on these matters? -- Is this generally only a matter of color spaces and transformations between them? or ... -- Is this also dependent on specific printer models (eg. different office laser printers)? -- If yes, is there any source on information on the pecularities of these printers? kind regard and thanks Erik ___ 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 ___
Re: [NTG-context] Colors: printing vs. on screen
On 19-6-2011 1:53, Erik Margraf wrote: Dear List, I defined the following color for one of my documents: \definecolor[P][r=0.64,g=0.22,b=0.27] When I printed this document on a probably typical office laser printer (a Canon iRC), the colors didn't match. (not even close and I didn't like the printed color) This is probably no real surprise, but can anybody provide some insight or hints to information on these matters to me: -- Are spot colors the thing to use to get a grip on these matters? no, as your printer uses process colors (cmyk) -- Is this generally only a matter of color spaces and transformations between them? or ... indeed, often printer drivers apply some paper properties as well -- Is this also dependent on specific printer models (eg. different office laser printers)? yes, toner vs ink, kinds of paper, quality of renderer etc -- If yes, is there any source on information on the pecularities of these printers? specifying in cmyk might help Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] Colors: printing vs. on screen
-- Are spot colors the thing to use to get a grip on these matters? No, because spot colors are used to extend the printable range by colors not available in cmyk. You might be able to show such a color on your monitor, but not print it. -- Is this generally only a matter of color spaces and transformations between them? Yes, because your monitor uses RGB and your printer uses CMYK. The conversion between thetwo is not too complicated, but actually getting the same output from the two is hard. RGB is an additive model, CMYK is subtractive (read about the different models, wikipedia will do). The color impression you get by looking at the output is generated in completely different ways. or ... -- Is this also dependent on specific printer models (eg. different office laser printers)? -- If yes, is there any source on information on the pecularities of these printers? Each printer will print slightly different, that's the nature of things. Your best bet is to calibrate your monitor (also, search a bit on the web for ways to do this). Turn a few of your monitors knobs and see how the colors change - now imagine what variables come into play between your impression of the color shown by your monitor, the actual data, and the impression you get from your printer's output! You can also try specifying a color in CMYK and see if the output changes. Regards Christoph ___ 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 ___
Re: [NTG-context] Colors: printing vs. on screen
Yes, because your monitor uses RGB and your printer uses CMYK. The conversion between thetwo is not too complicated, but actually getting the same output from the two is hard. RGB is an additive model, CMYK is subtractive (read about the different models, wikipedia will do). The color impression you get by looking at the output is generated in completely different ways. Most office printers cope well with RGB (sRGB) colors, a lot of inkjet printers even better than with CMYK colors, because they're optimized for home dummy use. But (as Christoph pointed out) your printer can be as great as it goes, you'll never get a similar color impression if your monitor's set to some extreme setting - and most monitors that I saw outside of the graphical branch are set to nonsense settings, e.g. max contrast. Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer) ___ 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 ___
Re: [NTG-context] colors for pretty-printing
I need to not redefine. Quoting Hans: maybe you should protect the color names as for instance redefining darkred might not be the intention In fact, I just need to find unique names for my colors to not overload the existing ones… Renaud I still don't understand. Where do you need to redefine darkred? Cheers, Peter ___ 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 ___
Re: [NTG-context] colors for pretty-printing
On Wed, Dec 08 2010, Renaud AUBIN wrote: In fact, I just need to find unique names for my colors to not overload the existing ones… \doifcolorelse{new funny color} {Error: funny color already exists!} {\definecolor[new funny color][...]} With \setupcolor[ema] or \setupcolor[ema, x11, xwi] there are already a lot of predefined colors, so I don't think that you need new color definitions in the module. Peter -- Contact information: http://pmrb.free.fr/contact/ ___ 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 ___
Re: [NTG-context] colors for pretty-printing
Ok but then why did you define a specific color palet? local function color_init() color = 0 local def_colors = -- \setupcolor[ema] introduces new line... \\definecolor [darkred] [r=.545098] .. \\definecolor [orchid][r=.854902,g=.439216,b=.839216] .. \\definecolor [rosybrown] [r=.737255,g=.560784,b=.560784] .. \\definecolor [forestgreen] [r=.13,g=.545098,b=.13] .. … Renaud With \setupcolor[ema] or \setupcolor[ema, x11, xwi] there are already a lot of predefined colors, so I don't think that you need new color definitions in the module ___ 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 ___
Re: [NTG-context] colors for pretty-printing
On Fri, Dec 10 2010, Renaud AUBIN wrote: Ok but then why did you define a specific color palet? local function color_init() color = 0 local def_colors = -- \setupcolor[ema] introduces new line... The comment says it: \setupcolor[ema] introduces new line and that's annoying when you do inline typing: bla bla \typeC{int main(){}} bla bla The \definecolor[] lines (dirty workaround) were just copied from colo-ema.tex. The problem with the pretty-c.lua was, that color_init() was called at every \typeC{} or \startC. In your t-pretty-c.mkiv you can use \setupcolor[ema] without problems. Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/ ___ 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 ___
Re: [NTG-context] colors for pretty-printing
Done and committed on http://gitorious.org/c-pretty-printer-module-for-context-mark-iv In your t-pretty-c.mkiv you can use \setupcolor[ema] without problems. ___ 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 ___
[NTG-context] colors for pretty-printing (was: Re: pret-c.lua - v-c.lua)
On Mon, Dec 06 2010, Renaud AUBIN wrote: Concerning the color abstraction patch, one needs just to overload Ccomment, Cpreproc, Cstring, Ctype, Ckeyword, Cname and Cfuncnbound to use custom color scheme. You don't need that. There is already a standard interface for color and style configuration. Example: \setupstartstop[CSnippetComment][color=blue] So you can simplify t-pretty-c.mkiv: \unprotect \setupcolor[ema] \definestartstop [CSnippetName] [\c!color=darkgoldenrod, \c!style=] and so on... Peter -- Contact information: http://pmrb.free.fr/contact/ ___ 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 ___
Re: [NTG-context] colors for pretty-printing (was: Re: pret-c.lua - v-c.lua)
On Tue, 7 Dec 2010, Peter Münster wrote: On Mon, Dec 06 2010, Renaud AUBIN wrote: Concerning the color abstraction patch, one needs just to overload Ccomment, Cpreproc, Cstring, Ctype, Ckeyword, Cname and Cfuncnbound to use custom color scheme. You don't need that. There is already a standard interface for color and style configuration. Example: \setupstartstop[CSnippetComment][color=blue] So you can simplify t-pretty-c.mkiv: \unprotect \setupcolor[ema] \definestartstop [CSnippetName] [\c!color=darkgoldenrod, \c!style=] I have not looked into the new verbatim code yet, but I have been thinking about a similar interface for a new module that uses external programs for syntax highlighting (sort of a superset of t-vim that will allow one to use other programs like pgyments, etc.). Why are you using a C prefix for all environments? Isn't it better to use a syntax like this: \startsetups[verbatim:C] \definestartstop[SnippetName][color=...,style=...] \definestartstop[string][color=...,style=...] \stopsetups and then pass setups=verbatim:C to an appropriate \setup... command. That will make it easy to share the same syntax highlighting between different languages. Aditya ___ 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 ___
Re: [NTG-context] colors for pretty-printing
On 7-12-2010 2:29, Aditya Mahajan wrote: On Tue, 7 Dec 2010, Peter Münster wrote: On Mon, Dec 06 2010, Renaud AUBIN wrote: Concerning the color abstraction patch, one needs just to overload Ccomment, Cpreproc, Cstring, Ctype, Ckeyword, Cname and Cfuncnbound to use custom color scheme. You don't need that. There is already a standard interface for color and style configuration. Example: \setupstartstop[CSnippetComment][color=blue] So you can simplify t-pretty-c.mkiv: \unprotect \setupcolor[ema] \definestartstop [CSnippetName] [\c!color=darkgoldenrod, \c!style=] I have not looked into the new verbatim code yet, but I have been thinking about a similar interface for a new module that uses external programs for syntax highlighting (sort of a superset of t-vim that will allow one to use other programs like pgyments, etc.). it all boils down hooking in a parser then: \startluacode local function parser(s) local s = somexternalthing(s) -- feedback s end visualizers.register(myparser, { parser = parser }) \stopluacode \starttyping[option=myparser] \stoptyping Why are you using a C prefix for all environments? Isn't it better to use a syntax like this: \startsetups[verbatim:C] \definestartstop[SnippetName][color=...,style=...] \definestartstop[string][color=...,style=...] \stopsetups and then pass setups=verbatim:C to an appropriate \setup... command. That will make it easy to share the same syntax highlighting between different languages. it's hard to come up with common names for characteristics for all those languages but at some point we can have a set predefined as default btw, startstop can inherit (now): \definestartstop [MetapostSnippet] [DefaultSnippet] etc so there is no need for setups - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] colors for pretty-printing
On Tue, 7 Dec 2010, Hans Hagen wrote: On 7-12-2010 2:29, Aditya Mahajan wrote: On Tue, 7 Dec 2010, Peter Münster wrote: On Mon, Dec 06 2010, Renaud AUBIN wrote: Concerning the color abstraction patch, one needs just to overload Ccomment, Cpreproc, Cstring, Ctype, Ckeyword, Cname and Cfuncnbound to use custom color scheme. You don't need that. There is already a standard interface for color and style configuration. Example: \setupstartstop[CSnippetComment][color=blue] So you can simplify t-pretty-c.mkiv: \unprotect \setupcolor[ema] \definestartstop [CSnippetName] [\c!color=darkgoldenrod, \c!style=] I have not looked into the new verbatim code yet, but I have been thinking about a similar interface for a new module that uses external programs for syntax highlighting (sort of a superset of t-vim that will allow one to use other programs like pgyments, etc.). it all boils down hooking in a parser then: \startluacode local function parser(s) local s = somexternalthing(s) -- feedback s end visualizers.register(myparser, { parser = parser }) \stopluacode \starttyping[option=myparser] \stoptyping Thanks for the explanation. But, I am not too keen to write parsers on my own when I can easily borrow existing ones. Why are you using a C prefix for all environments? Isn't it better to use a syntax like this: \startsetups[verbatim:C] \definestartstop[SnippetName][color=...,style=...] \definestartstop[string][color=...,style=...] \stopsetups and then pass setups=verbatim:C to an appropriate \setup... command. That will make it easy to share the same syntax highlighting between different languages. it's hard to come up with common names for characteristics for all those languages But it does allow you to choose a color scheme for pretty printing. This is similar to how most editors choose color schemes. but at some point we can have a set predefined as default btw, startstop can inherit (now): \definestartstop [MetapostSnippet] [DefaultSnippet] etc so there is no need for setups Setups have an advantage that one does not pollute the cs names. After all, \DefaultSnippet is not useful outside the pretty printing region. An alternative could be to use a namsespace in define in all definitions, e.g., \definestartstop[visualizer::Snippet] On a related note, does it make sense to add foregroundcolor and foregroupdstyle keys to \definebar? (Then, bars will be an appropriate and versatile mechanism to define syntax highlighting regions). Aditya___ 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 ___
Re: [NTG-context] colors for pretty-printing
On 7-12-2010 6:57, Aditya Mahajan wrote: Thanks for the explanation. But, I am not too keen to write parsers on my own when I can easily borrow existing ones. sure, but a simple one can be: function myparser(str) .. call your prog do do something with str and return the result end But it does allow you to choose a color scheme for pretty printing. This is similar to how most editors choose color schemes. sure, but my experience is that there are easily 10-15 different categories and naming them right is somewhat tricky On a related note, does it make sense to add foregroundcolor and foregroupdstyle keys to \definebar? (Then, bars will be an appropriate and versatile mechanism to define syntax highlighting regions). maybe Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] colors for pretty-printing
You don't need that. There is already a standard interface for color and style configuration. Example: \setupstartstop[CSnippetComment][color=blue] So you can simplify t-pretty-c.mkiv: \unprotect \setupcolor[ema] \definestartstop [CSnippetName] [\c!color=darkgoldenrod, \c!style=] and so on... OK, but anyway, I have to protect the color names (to prevent darkred redefinition for example ;) )… So, I have made the choice to use Csomething and it is not annoying as soon as the source color names are kept… Cheers Renaud ___ 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 ___
Re: [NTG-context] colors for pretty-printing
On Tue, Dec 07 2010, Renaud AUBIN wrote: So you can simplify t-pretty-c.mkiv: \unprotect \setupcolor[ema] \definestartstop [CSnippetName] [\c!color=darkgoldenrod, \c!style=] and so on... OK, but anyway, I have to protect the color names (to prevent darkred redefinition for example ;) ) I still don't understand. Where do you need to redefine darkred? Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/ ___ 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 ___
Re: [NTG-context] colors for pretty-printing
On Tue, Dec 7, 2010 at 2:30 PM, Hans Hagen pra...@wxs.nl wrote: On 7-12-2010 6:57, Aditya Mahajan wrote: Thanks for the explanation. But, I am not too keen to write parsers on my own when I can easily borrow existing ones. sure, but a simple one can be: function myparser(str) .. call your prog do do something with str and return the result end OK. This sounds much easier than writing my own wrappers. I will try to port the t-vim module to use the new code. Aditya ___ 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 ___
Re: [NTG-context] colors without \definecolor
On Sun, Feb 7, 2010 at 22:56, Wolfgang Schuster wrote: Am 07.02.10 07:24, schrieb Aditya Mahajan: while \color can only be used as \color[rgb]{...}. No. Both \color[rgb]{...} and {\color[rgb]...} are valid D’oh. I looked in the source and missed this but I wonder if this had been always the case because the manuals {and the wiki) mention only \color[name]{...}. \colored is a rather recent command. Mojca ___ 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 ___
Re: [NTG-context] colors without \definecolor
On 7-2-2010 22:56, Wolfgang Schuster wrote: Am 07.02.10 07:24, schrieb Aditya Mahajan: while \color can only be used as \color[rgb]{...}. No. Both \color[rgb]{...} and {\color[rgb]...} are valid D’oh. I looked in the source and missed this but I wonder if this had been always the case because the manuals {and the wiki) mention only \color[name]{...}. all commands that use \groupedcommand have that property - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] colors without \definecolor
Am 08.02.10 09:19, schrieb Mojca Miklavec: D’oh. I looked in the source and missed this but I wonder if this had been always the case because the manuals (and the wiki) mention only \color[name]{...}. \colored is a rather recent command. I meant the manuals and wiki mention \color[name]{...} but not the form {\color[...]...}. 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 ___
Re: [NTG-context] colors without \definecolor
Am 08.02.10 09:40, schrieb Hans Hagen: D’oh. I looked in the source and missed this but I wonder if this had been always the case because the manuals {and the wiki) mention only \color[name]{...}. all commands that use \groupedcommand have that property But used \color always \groupedcommand or was this added later and the original definition was what is mentioned in the manual (\color[]{})? 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 ___
Re: [NTG-context] colors without \definecolor
On 8-2-2010 9:55, Wolfgang Schuster wrote: Am 08.02.10 09:40, schrieb Hans Hagen: D’oh. I looked in the source and missed this but I wonder if this had been always the case because the manuals {and the wiki) mention only \color[name]{...}. all commands that use \groupedcommand have that property But used \color always \groupedcommand or was this added later and the original definition was what is mentioned in the manual (\color[]{})? it's a very old command so it might not have used groupedcommand in the past also, at the time of manual writing no groupedcommand like things were there anyway but .. there's another reason ... \color{...} does not grab an argument but does some aftergroup trickery so it might not work in all cases also in mkii we inject literals and we could end up with dangling revert color cases being nodes that could interfere somehow mkiv is more robust - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] colors without \definecolor
Am 07.02.10 07:24, schrieb Aditya Mahajan: while \color can only be used as \color[rgb]{...}. No. Both \color[rgb]{...} and {\color[rgb]...} are valid D’oh. I looked in the source and missed this but I wonder if this had been always the case because the manuals {and the wiki) mention only \color[name]{...}. 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 ___
Re: [NTG-context] colors without \definecolor
On Sat, 6 Feb 2010, Wolfgang Schuster wrote: Am 05.02.10 15:49, schrieb Philipp Gesang: Is there a difference (other than syntax) between \colored[rgb] and the according \definecolor[name][rgb] -- \color[name] commands? No, \colored is \definecolor + \color except you can use it in the form \colored[rgb]{...} and {\colored[rgb]...} while \color can only be used as \color[rgb]{...}. No. Both \color[rgb]{...} and {\color[rgb]...} are valid \definecolor[myred][r=0.65] \starttext {normal text \color[myred]{red text} normal text} {normal text {\color[myred]red text} normal text} \stoptext Aditya ___ 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 ___
Re: [NTG-context] colors without \definecolor
Wolfgang, all, On 2010-02-05 08:31:35, Wolfgang Schuster wrote: \colored[r=...,g=...,b=...]{...} or {\colored[r=...,g=...,b=...]...} Thank you very much, I wikified it. Is there a difference (other than syntax) between \colored[rgb] and the according \definecolor[name][rgb] -- \color[name] commands? Philipp pgpeYNdmcwSZk.pgp Description: PGP signature ___ 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 ___
Re: [NTG-context] colors without \definecolor
Am 05.02.10 15:49, schrieb Philipp Gesang: Is there a difference (other than syntax) between \colored[rgb] and the according \definecolor[name][rgb] -- \color[name] commands? No, \colored is \definecolor + \color except you can use it in the form \colored[rgb]{...} and {\colored[rgb]...} while \color can only be used as \color[rgb]{...}. 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 ___
[NTG-context] colors without \definecolor
Hi all, I understand that in order to use a color with \color[somecolor]{colored text} I first have to \definecolor[somecolor][r=.4,g=0,b=1]. Currently I'm trying to do automated colorizing with the help of some lua code and I'd like to make up rgb vectors on the spot without having to \definecolor them first, e.g. something like \color[r=.4,g=0,b=1] {colored text}. Is there a way to achieve this in mkiv? (Right now I'm assigning new rgb values to the same color name whenever the function is called that concatenates the next \color[]{} statement. This seems a bit verbose and hacky to me.) Thanks in advance, Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpmr9RKdR6JU.pgp Description: PGP signature ___ 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 ___
Re: [NTG-context] colors without \definecolor
Am 04.02.10 21:41, schrieb Philipp Gesang: Hi all, I understand that in order to use a color with \color[somecolor]{colored text} I first have to \definecolor[somecolor][r=.4,g=0,b=1]. Currently I'm trying to do automated colorizing with the help of some lua code and I'd like to make up rgb vectors on the spot without having to \definecolor them first, e.g. something like \color[r=.4,g=0,b=1] {colored text}. Is there a way to achieve this in mkiv? (Right now I'm assigning new rgb values to the same color name whenever the function is called that concatenates the next \color[]{} statement. This seems a bit verbose and hacky to me.) \colored[r=...,g=...,b=...]{...} or {\colored[r=...,g=...,b=...]...} 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 ___
[NTG-context] colors in mkiv
Hi, does it make any sense to disable colors by default in mkiv? 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors in mkiv
Am 12.04.2009 um 12:55 schrieb Hans Hagen: Wolfgang Schuster wrote: Hi, does it make any sense to disable colors by default in mkiv? you mean: enabled by default? Yes. 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors in mkiv
Wolfgang Schuster wrote: Hi, does it make any sense to disable colors by default in mkiv? you mean: enabled by default? - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors in mkiv
Wolfgang Schuster wrote: Am 12.04.2009 um 12:55 schrieb Hans Hagen: Wolfgang Schuster wrote: Hi, does it make any sense to disable colors by default in mkiv? you mean: enabled by default? Yes. no problem for me (as i always eneble color) .. so if there are no big complaints on the list we can do it ... remind me in a few weeks then - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors in mkiv
I would like to support the idea of enabling colors by default. Not in the least because I always tend to forget it at first. And if it doesn't really slow the system down, there seems no reason not to enable by default. Hans van der Meer On 12 apr 2009, at 14:43, Hans Hagen wrote: Wolfgang Schuster wrote: Am 12.04.2009 um 12:55 schrieb Hans Hagen: Wolfgang Schuster wrote: Hi, does it make any sense to disable colors by default in mkiv? you mean: enabled by default? Yes. no problem for me (as i always eneble color) .. so if there are no big complaints on the list we can do it ... remind me in a few weeks then - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Colors
Hi Taco, hi Hans, Thank you very much, it works fine again. Greetings Lutz 2009/3/30 Hans Hagen pra...@wxs.nl Lutz Haseloff wrote: Hi all, with the latest ConTeXt ver: 2009.03.29 13:28 MKIV and LuaTeX, Version snapshot-0.37.0-2009032922 I can't get colored text: \setupcolors[state=start] \setuppagenumbering[state=stop] \starttext {\red red} {\green this is typeset in green} {\middlemagenta this is typeset in dark middlemagenta} \stoptext taco and i have it running here ... has to do with low level change in attributes so the upcoming beta also needs a new binary - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Colors
Lutz Haseloff wrote: Hi all, with the latest ConTeXt ver: 2009.03.29 13:28 MKIV and LuaTeX, Version snapshot-0.37.0-2009032922 I can't get colored text: \setupcolors[state=start] \setuppagenumbering[state=stop] \starttext {\red red} {\green this is typeset in green} {\middlemagenta this is typeset in dark middlemagenta} \stoptext could be related to the new binary ... we're looking into it Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Colors
Hans Hagen wrote: Lutz Haseloff wrote: Hi all, with the latest ConTeXt ver: 2009.03.29 13:28 MKIV and LuaTeX, Version snapshot-0.37.0-2009032922 I can't get colored text: could be related to the new binary ... we're looking into it Yes, that was totally my fault. The current trunk should be OK again. Best wishes, Taco ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Colors
Lutz Haseloff wrote: Hi all, with the latest ConTeXt ver: 2009.03.29 13:28 MKIV and LuaTeX, Version snapshot-0.37.0-2009032922 I can't get colored text: \setupcolors[state=start] \setuppagenumbering[state=stop] \starttext {\red red} {\green this is typeset in green} {\middlemagenta this is typeset in dark middlemagenta} \stoptext taco and i have it running here ... has to do with low level change in attributes so the upcoming beta also needs a new binary - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Colors
Hi all, with the latest ConTeXt ver: 2009.03.29 13:28 MKIV and LuaTeX, Version snapshot-0.37.0-2009032922 I can't get colored text: \setupcolors[state=start] \setuppagenumbering[state=stop] \starttext {\red red} {\green this is typeset in green} {\middlemagenta this is typeset in dark middlemagenta} \stoptext Greetings Lutz ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] colors questions
Source: texshow (1) \setupinteraction color name contrastcolor name How do you set the setupinteraction contrastcolor background color ? (2) \defineinteractionmenu, \setupinteractionmenu, \interactionbuttons color name background screen color none foreground name backgroundcolor name foregroundcolorname (2.1) What is background= - screen ? - color ? - foreground ? (2.2) What's the difference between - color and foregroundcolor ? - background=name and backgroundcolor=name ? - how do you set a, or override (1)'s, selected item background color ? -- Best, Alan * using ConTeXt ver: 2008.08.18 14:00 MKIV fmt: 2008.8.22 int: english/english (on Windows XP) ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors questions
Thanks Hans. Still about setupinteraction's contrastcolor. In an interactionmenu, how do you maintain an item's color to contrastcolor when the corresponding section spans over more than one screen/page ? It switches back to color after the first screen/page. On Mon, Sep 8, 2008 at 11:30 AM, Hans Hagen [EMAIL PROTECTED] wrote: Alan Stone wrote: Source: texshow (1) \setupinteraction color name contrastcolor name How do you set the setupinteraction contrastcolor background color ? hm, there is no interactionbackgroundcolor (maybe some day in mkiv when i've redone hyperlinks) (2) \defineinteractionmenu, \setupinteractionmenu, \interactionbuttons color name background screen color none foreground name backgroundcolor name foregroundcolorname (2.1) What is background= - screen ? grayscale - color ? color - foreground ? color of content (like text) (2.2) What's the difference between - color and foregroundcolor ? foregroundcolor is somewhat special in the sense that it applies to the 'framed' content; in mkiv we use whatsits to track color and using colors around your boxed content might interfere so therefore we have this special less interfering foregroundcolor; in mkiv this interference is gone (by design) - background=name and backgroundcolor=name ? background={somecolorname,somebackgroundthing,somemore) i.e. can be a sequence of things to be applied (just grep for background= in the s-*.tex files) Hans (keep in mind that tex itself has no concept of color, nor of backgrounds) -- Best, Alan * using ConTeXt ver: 2008.08.18 14:00 MKIV fmt: 2008.8.22 int: english/english (on Windows XP) ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors questions
Alan Stone wrote: Thanks Hans. Still about setupinteraction's contrastcolor. In an interactionmenu, how do you maintain an item's color to contrastcolor when the corresponding section spans over more than one screen/page ? It switches back to color after the first screen/page. indeed, just a compare of the reference page with the current page; no spans Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors questions
indeed, just a compare of the reference page with the current page; no spans That's a feature request then. Samewise for interaction buttons. Thanks, Alan On Mon, Sep 8, 2008 at 1:37 PM, Hans Hagen [EMAIL PROTECTED] wrote: Alan Stone wrote: Thanks Hans. Still about setupinteraction's contrastcolor. In an interactionmenu, how do you maintain an item's color to contrastcolor when the corresponding section spans over more than one screen/page ? It switches back to color after the first screen/page. indeed, just a compare of the reference page with the current page; no spans Hans ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors questions
Alan Stone wrote: Source: texshow (1) \setupinteraction color name contrastcolor name How do you set the setupinteraction contrastcolor background color ? hm, there is no interactionbackgroundcolor (maybe some day in mkiv when i've redone hyperlinks) (2) \defineinteractionmenu, \setupinteractionmenu, \interactionbuttons color name background screen color none foreground name backgroundcolor name foregroundcolorname (2.1) What is background= - screen ? grayscale - color ? color - foreground ? color of content (like text) (2.2) What's the difference between - color and foregroundcolor ? foregroundcolor is somewhat special in the sense that it applies to the 'framed' content; in mkiv we use whatsits to track color and using colors around your boxed content might interfere so therefore we have this special less interfering foregroundcolor; in mkiv this interference is gone (by design) - background=name and backgroundcolor=name ? background={somecolorname,somebackgroundthing,somemore) i.e. can be a sequence of things to be applied (just grep for background= in the s-*.tex files) Hans (keep in mind that tex itself has no concept of color, nor of backgrounds) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors in pgf within context
Hello, Another problem with PGF+ConTeXt is the handling of cmyk colors: \usemodule[tikz] \setupcolors[state=start] \definecolor[my_yellow][c=0,m=0.3,y=0.94,k=0] \starttext \startcolor[my_yellow] Yellow text. \stopcolor \starttikzpicture \fill[my_yellow] (0,0) circle(1); \stoptikzpicture \stoptext CMYK colors work in ConTeXt but do not get passed correctly to PGF/TikZ. A work-around is to transform to rgb : \definecolor[my_yellow][r=0.98,g=0.698,b=0.09] % 250,178,23 #FAB217 This seems to be a documented bug; Perhaps it will be fixed someday... Alan On Tuesday 19 February 2008 04:47:35 Aditya Mahajan wrote: On Mon, 18 Feb 2008, Jesse Alama wrote: Hi Aditya, Thanks for the help -- I think I now see why there is such trouble with colors in pgf and context. It looks like one can systematically transform LaTeX-like PGF examples of \color into ConTeXt examples. The reason why this came up is that I'm trying to go through Till Tantau's Example for Karl's Students tutorial in the PGF/TikZ manual. Has anyone managed to ConTeXt-ify that example? I did that some time back while testing tikz. I will send that file as a reply to this email, since I am not sure if it will go through the mailing list because of its size. The example features some \definecolor's which I just did away with (sadly) by simply substituting their defining values for their occurences. (This is unfortunate, but perhaps necessary until some other mechanism is produced.) The problem is that the text box to the right of the picture is supposed to be colored, and with rounded corners. But the box is missing. Look at p. 20 of The TikZ manual make a lot of uses of the xcolor syntax (e.g. \color{red!20}). There is no equivalent ConTeXt syntax. You need to define a color, say lightred, as follows \definecolor[lightred][r=0.2] For tikz key-value options, pgf works behind the scene to define appropriate colors, so xcolor syntax works for them. So \fill[fillcolor=red!20] will work as expected. However, when using \color inside any box, you need to follow ConTeXt syntax. So \color[red!20] will not work, you need to define a context color and then use that. Hope that this clarifies some things. Aditya ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- Alan Braslau CEA DSM-IRAMIS-SPEC CNRS URA 2464 Orme des Merisiers 91191 Gif-sur-Yvette cedex FRANCE tel: +33 1 69 08 73 15 fax: +33 1 69 08 87 86 mailto:[EMAIL PROTECTED] http://www-dna2006.cea.fr/ .''`. : :' : `. `'` `- ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors in pgf within context
Jesse Alama wrote: Hi Aditya, Thanks for the help -- I think I now see why there is such trouble with colors in pgf and context. It looks like one can systematically transform LaTeX-like PGF examples of \color into ConTeXt examples. keep in mind that color handles sveral grouping cases: {\somecolor whatever} \color[somecolor]{whatever} all use the same underlying mechanissm (and sometimes aftergroup to revert to the outer color; this may interfere when grouping is kind of unpredictable in case of doubt: \color[name]{..} works best (explicit braces) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors in pgf within context
Aditya Mahajan [EMAIL PROTECTED] writes: The example features some \definecolor's which I just did away with (sadly) by simply substituting their defining values for their occurences. (This is unfortunate, but perhaps necessary until some other mechanism is produced.) The problem is that the text box to the right of the picture is supposed to be colored, and with rounded corners. But the box is missing. Look at p. 20 of The TikZ manual make a lot of uses of the xcolor syntax (e.g. \color{red!20}). There is no equivalent ConTeXt syntax. You need to define a color, say lightred, as follows \definecolor[lightred][r=0.2] For tikz key-value options, pgf works behind the scene to define appropriate colors, so xcolor syntax works for them. So \fill[fillcolor=red!20] will work as expected. However, when using \color inside any box, you need to follow ConTeXt syntax. So \color[red!20] will not work, you need to define a context color and then use that. I'm still not able to get fillcolor to work with the information box: \starttikzpicture[scale=4,information text/.style={fill=red}] \draw[xshift=1.85cm] node[right,text width=6cm,information text] { The \color[green]{angle $\alpha$} is $30^\circ$ in the example ($\pi/6$ in radians). The \color[red]{sine of $\alpha$}, which is the height of the red line, is \startformula \color[red]{\sin \alpha} = 1/2. \stopformula By the Theorem of Pythagoras ... }; Is ConTeXt correctly parsing the key information tex/.style? Jesse -- Jesse Alama ([EMAIL PROTECTED]) ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors in pgf within context
Hi Aditya, Thanks for the help -- I think I now see why there is such trouble with colors in pgf and context. It looks like one can systematically transform LaTeX-like PGF examples of \color into ConTeXt examples. The reason why this came up is that I'm trying to go through Till Tantau's Example for Karl's Students tutorial in the PGF/TikZ manual. Has anyone managed to ConTeXt-ify that example? The closest that I've come is \usemodule[tikz] \setupcolors[state=start] \starttext \starttikzpicture [scale=3, line cap=thin, %Styles axes/.style=, important line/.style={very thick}, information text/.style={rounded corners,fill=red!10,inner sep=1ex}] % Local definitions \def\costhirty{0.8660256} % The graphic \draw[help lines,step=0.5cm] (-1.4,-1.4) grid (1.4,1.4); \draw (0,0) circle (1cm); \startscope[axes] \draw[-] (-1.5,0) -- (1.5,0) node[right] {$x$} coordinate(x axis); \draw[-] (0,-1.5) -- (0,1.5) node[above] {$y$} coordinate(y axis); \foreach \x/\xtext in {-1, -.5/-\frac{1}{2}, 1} \draw[xshift=\x cm] (0pt,1pt) -- (0pt,-1pt) node[below,fill=white] {$\xtext$}; \foreach \y/\ytext in {-1, -.5/-\frac{1}{2}, .5/\frac{1}{2}, 1} \draw[yshift=\y cm] (1pt,0pt) -- (-1pt,0pt) node[left,fill=white] {$\ytext$}; \stopscope \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0pt) arc(0:30:3mm); \draw (15:2mm) node[green!50!black] {$\alpha$}; \draw[important line,red] (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x axis); \draw[important line,orange!80!black] (1,0) -- node[right=1pt,fill=white] { $\displaystyle \tan \alpha \color[black]{=} \frac{\color[red]{\sin \alpha}}{\color[blue]{\cos \alpha}}$} (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t); \draw (0,0) -- (t); \draw[xshift=1.85cm] node[right,text width=6cm,information text] { The \color[green!50!black]{angle $\alpha$} is $30^\circ$ in the example ($\pi/6$ in radians). The \color[red]{sine of $\alpha$}, which is the height of the red line, is \startformula \color[red]{\sin \alpha} = 1/2. \stopformula By the Theorem of Pythagoras ... }; \stoptikzpicture \stoptext The example features some \definecolor's which I just did away with (sadly) by simply substituting their defining values for their occurences. (This is unfortunate, but perhaps necessary until some other mechanism is produced.) The problem is that the text box to the right of the picture is supposed to be colored, and with rounded corners. But the box is missing. Look at p. 20 of http://altermundus.com/downloads/pgfmanual_cvs.pdf to see what I mean. Also, the phrase angle $\alpha$ is supposed to be in a kind of green, but that's not working either. What might be happening? Thanks, Jesse Aditya Mahajan [EMAIL PROTECTED] writes: I am CCing to the context list also. On Mon, 18 Feb 2008, Jesse Alama wrote: Hi Aditya, I recently came across a thread on the PGF users mailing list in which you mention some problems with ConTeXt, PGF and colors. For example: http://article.gmane.org/gmane.comp.tex.pgf.user/38 Have these issues beein resolved for your? I just downloaded PFG 1.18 from the modules part of the contextgarden, installed it, and, when trying to compile the following example PGF code \starttikzpicture[scale=3] \clip (-2,-0.2) rectangle (2,0.8); \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4); \filldraw[fill=green!20,draw=green!50!black] (0,0) -- (3mm,0mm) arc (0:30:3mm) -- cycle; \draw[-] (-1.5,0) -- (1.5,0) coordinate (x axis); \draw[-] (0,-1.5) -- (0,1.5) coordinate (y axis); \draw (0,0) circle (1cm); \draw[very thick,red] (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x axis); \draw[very thick,blue] (30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0); \draw[very thick,orange] (1,0) -- node [right=1pt,fill=white] {$\displaystyle \tan \alpha \color{black}= \frac{{\color[red]\sin \alpha}}{{\color[blue]\cos \alpha}}$} (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t); \draw (0,0) -- (t); \foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1} \draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north,fill=white] {$\xtext$}; \foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1} \draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east,fill=white] {$\ytext$}; \stoptikzpicture (which is taken from the PGF manual), I get ! Use of \color doesn't match its definition. [EMAIL PROTECTED] ...{$\displaystyle \tan \alpha \color { black}= \frac {{\color {re... [EMAIL PROTECTED]@[EMAIL PROTECTED] ...mmand [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]@[EMAIL PROTECTED]@... [EMAIL PROTECTED]@[EMAIL PROTECTED] [EMAIL PROTECTED]@onpath
[NTG-context] colors in luatex
Hi, this minimal example compiles fine in mkii: \setupcolors[state=start] \starttext \starttabulate \startcolor[red] \NC One \NC A \NC \NR \NC Two \NC B \NC \NR \stopcolor \NC Three \NC C \NC \NR \stoptabulate \stoptext With mkiv, I get this error: ! Missing \endgroup inserted. inserted text \endgroup to be read again \endtemplate template \endtemplate \tabulatenormalcolumn #1- \iftabulateequal \tabulateequalpos \else \tabulat... \tabulatecontent -\par \startcolor [red] \NC One \NC A \NC \NR \NC Two \NC ... \fulltabulatecontent ...dcontent \tabulatecontent \tabulatetailcontent \remo... ... l.13 \stoptabulate Bug, or anything wrong with the code? Thomas ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] colors in luatex
Thomas A. Schmitz wrote: Hi, this minimal example compiles fine in mkii: \setupcolors[state=start] \starttext \starttabulate \startcolor[red] \NC One \NC A \NC \NR \NC Two \NC B \NC \NR \stopcolor \NC Three \NC C \NC \NR \stoptabulate \stoptext well, with mkii you're just lucky, since this is not supposed to work anyway; you're mixing grouping models and it's pure luck if an aftergroup trick then injects the right egroup you need to switch inside the cells Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Colors and images Context
2 questions for colors 1) Does ConTeXt offer complete color gestion as pdf spec 1.6 or there are some features not implemented ? 2) Preparing a pdf with bitmap colored images for offset press (ie covers for manuals): are png or jpeg an optimal solution or tiff is better ? RGB or CMYK ? Thanks in advance luigi ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Colors and images Context
luigi scarso wrote: 2 questions for colors 1) Does ConTeXt offer complete color gestion as pdf spec 1.6 or there are some features not implemented ? what do you need ... process- and spotcolors are implemented, as are duotones; transparency has been around for years now. 2) Preparing a pdf with bitmap colored images for offset press (ie covers for manuals): are png or jpeg an optimal solution or tiff is better ? RGB or CMYK ? normally an unscaled cmyk jpeg of medium compression quality is ok (a 24 meg tiff graphic is not per definition better than a 4 meg jpeg image) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Colors and images Context
normally an unscaled cmyk jpeg of medium compression quality is ok (a 24 meg tiff graphic is not per definition better than a 4 meg jpeg image) Hans Thanks Also in pdftex mailing list, thread Best bitmap image format? ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] colors in MPgraphic
In MPgrapic I do want my own colors for drawing lines etc. These are set up in plain.mf's (_op_ and background). In \startMPinclusions I just do that in order to get the drawing color I want. But then \startMPgraphic appears to reset colors (both _op_ and background I suspect). Can this be changed? In plain.mf there is already a setup, so there seems no reason for \startMPgraphic to interfere. It would be nice if the color setup done in \startMPinclusions would be honored. It is a nuisance to have them set up in a special initalization file and then being forced to repeat this at the start of every graphic. Question: what tinkering with metapost parameters is done in \startMPgraphic exactly? (I could not find out readily from the ConTeXt sources) Which of these can be removed without danger for its operation, leaving settings in \startMPinclusions unchanged -- and will that be done? yours sincerely, dr. H. van der Meer ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] colors in MPgraphic
Question: what tinkering with metapost parameters is done in \startMPgraphic exactly? (I could not find out readily from the ConTeXt sources) Which of these can be removed without danger for its operation, leaving settings in \startMPinclusions unchanged -- and will that be done? Hans will probably answer you better, but in http://source.contextgarden.net/metafun.mp there are files with metafun macros included which may set their own colors. See those files. I doubt that any definitions can be removed without breaking anything (otherwise they wouldn't be there), but I agree that MPinclusions could/should be included AFTER metafun macros if they're not (I didn't check). Mojca ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] colors in MPgraphic
Mojca Miklavec wrote: Question: what tinkering with metapost parameters is done in \startMPgraphic exactly? (I could not find out readily from the ConTeXt sources) Which of these can be removed without danger for its operation, leaving settings in \startMPinclusions unchanged -- and will that be done? Hans will probably answer you better, but in http://source.contextgarden.net/metafun.mp there are files with metafun macros included which may set their own colors. See those files. I doubt that any definitions can be removed without breaking anything (otherwise they wouldn't be there), but I agree that MPinclusions could/should be included AFTER metafun macros if they're not (I didn't check). (1) metafun is a format and will be loaded first (2) inclusion scome after loading the format (3) context only sets a bunch of variables which tell metafun certain things i'm not sure what you mean with tinkering what parameters give you problems? concerning backgrounds and plain.mf ... metafont has bacckgrounds, metapost doesn't ; in mp the background is used for unfilling if you want to set the background / add own stuff you can probably best append the relevant settings / definitions to the extra_beginfig string (grep for that one) Hans ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] colors in MPgraphic
Hans van der Meer wrote: In MPgrapic I do want my own colors for drawing lines etc. These are set up in plain.mf's (_op_ and background). In \startMPinclusions I just do that in order to get the drawing color I want. But then \startMPgraphic appears to reset colors (both _op_ and background I suspect). The resetfig() macro from metafun clears _op_ and background. I don't know why, but there''' be a reason for it, I am sure ;-) There almost certainly is an 'official' way to add some statements to the beginning of each figure, but, in any case, it works if you store your settings in extra_beginfig: \startMPinclusions extra_beginfig := drawoptions(withcolor green); \stopMPinclusions Cheers, Taco ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] colors in MPgraphic
Taco Hoekwater wrote: Hans van der Meer wrote: In MPgrapic I do want my own colors for drawing lines etc. These are set up in plain.mf's (_op_ and background). In \startMPinclusions I just do that in order to get the drawing color I want. But then \startMPgraphic appears to reset colors (both _op_ and background I suspect). The resetfig() macro from metafun clears _op_ and background. I don't know why, but there''' be a reason for it, I am sure ;-) sure -) [i need to think a bit] There almost certainly is an 'official' way to add some statements to the beginning of each figure, but, in any case, it works if you store your settings in extra_beginfig: \startMPinclusions extra_beginfig := drawoptions(withcolor green); \stopMPinclusions maybe best is to append instead of assign Hans ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] colors in MPgraphic
On Jan 6, 2006, at 15:19, Taco Hoekwater wrote: There almost certainly is an 'official' way to add some statements to the beginning of each figure, but, in any case, it works if you store your settings in extra_beginfig: \startMPinclusions extra_beginfig := drawoptions(withcolor green); \stopMPinclusions Didn't know about extra_beginfig but that did the trick. Thanks! yours sincerely, dr. H. van der Meer ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] colors in MPgraphic
On Jan 6, 2006, at 18:56, Hans Hagen wrote: There almost certainly is an 'official' way to add some statements to the beginning of each figure, but, in any case, it works if you store your settings in extra_beginfig: \startMPinclusions extra_beginfig := drawoptions(withcolor green); \stopMPinclusions maybe best is to append instead of assign I am not sure about the exact syntax of that append. Is there a special macro in the context/metafun package or is it extra_beginfig := extra_beginfigdrawoptions(withcolor green);? yours sincerely, dr. H. van der Meer ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] colors in MPgraphic
Hans van der Meer wrote: I am not sure about the exact syntax of that append. Is there a special macro in the context/metafun package or is it extra_beginfig := extra_beginfigdrawoptions(withcolor green);? that's indeed an append (or actually a concat) Hans ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] colors in metafont
Normally metapost/metafun starts out drawing in black. Is it possible to change this globally, so that withcolor xyz is not needed everytime another color is wanted? Also is it possible to get/save/restore the current drawing color (a la savepen) in metapost/metafun? I searched through various manuals but I might have missed the reference. yours sincerely, dr. H. van der Meer ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] colors in metafont
Hans van der Meer wrote: Normally metapost/metafun starts out drawing in black. Is it possible to change this globally, so that withcolor xyz is not needed everytime another color is wanted? Also is it possible to get/save/restore the current drawing color (a la savepen) in metapost/metafun? I searched through various manuals but I might have missed the reference. not precisely, but drawoptions() comes close. beginfig(1); drawoptions(withcolor red); fill unitsquare scaled 20; drawoptions(); fill unitsquare scaled 10; endfig; Cheers, Taco ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Colors changing when applying transparent
Hi, I would like to use transparnt colors in one of the documents. However the resulting color is different with transparent color. Could anyone try the following code twice setting the %-sign in front of the fill-statement: \setupoutput[pdftex] \starttext \setupcolors[state=start] \startuseMPgraphic{tBG} path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; fill p withcolor \MPcolor{white}; % With normal colors, everything is fine (blue is really RGB(0,0,1) % fill p withcolor transparent(normal,.5,\MPcolor{white}); % This however results in fading of ALL of the colors... \stopuseMPgraphic \defineoverlay[textBG][\useMPgraphic{tBG}] \setupbackgrounds[page][background=color,backgroundcolor=blue] \setupbackgrounds[text][background=textBG] \input tufte \stoptext I would expect that the optical appearance of blue shoud not change after application of the transparent color to the gray areq. Regards Willi ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Colors changing when applying transparent
At 09:20 25/11/2003, you wrote: \setupoutput[pdftex] \starttext \setupcolors[state=start] \startuseMPgraphic{tBG} path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; fill p withcolor \MPcolor{white}; % With normal colors, everything is fine (blue is really RGB(0,0,1) % fill p withcolor transparent(normal,.5,\MPcolor{white}); % This however results in fading of ALL of the colors... \stopuseMPgraphic \defineoverlay[textBG][\useMPgraphic{tBG}] \setupbackgrounds[page][background=color,backgroundcolor=blue] \setupbackgrounds[text][background=textBG] \input tufte \stoptext Looks like an acrobat bug to me; if you use gsview, it works ok; there are more problems with acrobat and transparencies, like - no smoothing when a vector graphic is on top of a transparency - disappearing characters (esp very big ones) - funny flattener preview colors One of the reasons for such problems is that there is no 'reset graphics state' operator and i guess that occasionally the acrobat graphic state stack gets messed up. Hans - Hans Hagen | PRAGMA ADE | [EMAIL PROTECTED] Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com - information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf - ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Colors changing when applying transparent
Hi Hans, Indeed now I tried in Acrobat5 and the problem does not show up. There is probably another bug to be reported: I got a file, where with \startcombination ... \stopcombination two small pictures are placed next to each other. - When viewing the result in Acrobat6 everything looks ok. When printing the page, then the right picture will not show up on the print! Kind regards Willi At 10:37 25.11.2003, Hans wrote: At 09:20 25/11/2003, you wrote: \setupoutput[pdftex] \starttext \setupcolors[state=start] \startuseMPgraphic{tBG} path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; fill p withcolor \MPcolor{white}; % With normal colors, everything is fine (blue is really RGB(0,0,1) % fill p withcolor transparent(normal,.5,\MPcolor{white}); % This however results in fading of ALL of the colors... \stopuseMPgraphic \defineoverlay[textBG][\useMPgraphic{tBG}] \setupbackgrounds[page][background=color,backgroundcolor=blue] \setupbackgrounds[text][background=textBG] \input tufte \stoptext Looks like an acrobat bug to me; if you use gsview, it works ok; there are more problems with acrobat and transparencies, like - no smoothing when a vector graphic is on top of a transparency - disappearing characters (esp very big ones) - funny flattener preview colors One of the reasons for such problems is that there is no 'reset graphics state' operator and i guess that occasionally the acrobat graphic state stack gets messed up. Hans - Hans Hagen | PRAGMA ADE | [EMAIL PROTECTED] Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com - information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf - ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Colors changing when applying transparent
At 12:46 25/11/2003, you wrote: Indeed now I tried in Acrobat5 and the problem does not show up. There is probably another bug to be reported: I got a file, where with \startcombination ... \stopcombination two small pictures are placed next to each other. - When viewing the result in Acrobat6 everything looks ok. When printing the page, then the right picture will not show up on the print! there are indeed some bugs with regard to xforms; you can try to print 'as image' Hans ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Colors changing when applying transparent
Hoi Hans, Bedankt voor de link Het ziet er steeds gelikter uit. Op pagina 156 staat Haas'sche Schriftgiesserei Het apostroofje is vervangen door een kapitaal S-caron. - Dit is nogal raar omdat er op verschillende andere plekken in dit deel van het boek apostroven gebruikt worden. ?? Op pagina 164 laatste paragraaf: ... the single easiest way. - Ik denk, dat single weg kan. De common consensus TeX Live is commonly seen as the most easiest way to get up and running a TeX system. Groet Willi At 13:10 25.11.2003, Hans wrote: At 12:46 25/11/2003, you wrote: Indeed now I tried in Acrobat5 and the problem does not show up. There is probably another bug to be reported: I got a file, where with \startcombination ... \stopcombination two small pictures are placed next to each other. - When viewing the result in Acrobat6 everything looks ok. When printing the page, then the right picture will not show up on the print! there are indeed some bugs with regard to xforms; you can try to print 'as image' Hans ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list [EMAIL PROTECTED] http://www.ntg.nl/mailman/listinfo/ntg-context