sorry, wrong version of test file. the right one is attached now. Peter Rolf schrieb:
Hi,
there is a small bug in colo-hex, which leads to slightly wrong colors (at max. -0.390625%). In line 41 of both mark related files there is
\newdimen\hexcolorfraction \hexcolorfraction=\dimexpr(1pt/256) . This should be 255 (#fractions) instead of 256 (#values); I made the same error a quite while ago. If I patch the files, I get the correct color in case of mark ii, but mark iv still gives the wrong one (remade the formats). Mh, strange.
Here the output of my beloved 'tabbyCalc' (result of operation is always in next line, which is then used for next operation):
1/255 0,0039215686*255 0,999999993
1/256 0,00390625*255 0,99609375-1*100 -0,390625
I attached a small test file, which hopefully 'shows' (depends on your monitor) the difference. The border line goes from the lower left to the upper right corner; you have to look 'closely'. :D I case of pdftex you can also peek into the eps file to see the color values (before and after patching). No such help for mkiv. I have no clue why mkiv still gives the wrong color...
Best wishes, 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
\setupcolors[state=start] \setupcolor[hex] %% fraction= 1/255*65536= 257.004 %\newdimen\hexcolorfraction \hexcolorfraction=\dimexpr1pt/255\relax% = 257sp \definecolor[testcolor] [r=0.87843,g=0.87451,b=0.89020] % RGB(224,223,227)) \definecolor[testcolorHEX] [h=E0DFE3]% same as HEX (currently transformed to RGB(223,222,226) ) \startMPpage path p; p:= unitsquare xyscaled(5cm,5cm); fill (point 0 of p -- point 1 of p -- point 2 of p --cycle) withcolor \MPcolor{testcolorHEX}; % bottom right part of the square fill (point 0 of p -- point 3 of p -- point 2 of p --cycle) withcolor \MPcolor{testcolor}; % top left part \stopMPpage