summaryrefslogtreecommitdiffstats
path: root/src/color.h
diff options
context:
space:
mode:
authorJasper van de Gronde <jasper.vandegronde@gmail.com>2009-04-03 15:16:18 +0000
committerjaspervdg <jaspervdg@users.sourceforge.net>2009-04-03 15:16:18 +0000
commit863cc2bbd59361f196a10b08dc52f1f32ccc1e86 (patch)
treee885bbc1df3cfa943dd0f1136009e63cc9ccc7cc /src/color.h
parentio/crystalegg.xml: Fix a couple of textual errors. (diff)
downloadinkscape-863cc2bbd59361f196a10b08dc52f1f32ccc1e86.tar.gz
inkscape-863cc2bbd59361f196a10b08dc52f1f32ccc1e86.zip
And now gradients should be (almost) perfect... The gradient vector is set up to be a good approximation to the "true" gradient and it is used consistently throughout (I hope).
Also some other, minor, tweaks and a small bugfix. (bzr r7616)
Diffstat (limited to 'src/color.h')
-rw-r--r--src/color.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/color.h b/src/color.h
index 8fcc94438..bebeaec60 100644
--- a/src/color.h
+++ b/src/color.h
@@ -25,7 +25,7 @@
#define SP_RGBA32_B_U(v) (((v) >> 8) & 0xff)
#define SP_RGBA32_A_U(v) ((v) & 0xff)
#define SP_COLOR_U_TO_F(v) ((v) / 255.0)
-#define SP_COLOR_F_TO_U(v) ((unsigned int) ((v) * 255.9999))
+#define SP_COLOR_F_TO_U(v) ((unsigned int) ((v) * 255. + .5))
#define SP_RGBA32_R_F(v) SP_COLOR_U_TO_F (SP_RGBA32_R_U (v))
#define SP_RGBA32_G_F(v) SP_COLOR_U_TO_F (SP_RGBA32_G_U (v))
#define SP_RGBA32_B_F(v) SP_COLOR_U_TO_F (SP_RGBA32_B_U (v))