vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
533 stars 89 forks source link

[BUG] the rgb() function does not behave properly with low values #398

Closed anakojm closed 9 months ago

anakojm commented 9 months ago
settings.outformat="pdf";
size(20pt);

fill(unitcircle, rgb(1, 0, 0));

Outputs: a red circle. Expected output: black circle with the slightest bit of red.

I could reproduce by setting the output to png too.

anakojm commented 9 months ago

Upon reading the documentation, it seems that i should have used the RGB function instead. The documentation says that the rgb function accept 3 values each in the interval $[0, 1]$ but it seems like rgb will behave like RGB if values are higher than one, thus my confusion.