summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/dvi/dvi-document.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/backend/dvi/dvi-document.c b/backend/dvi/dvi-document.c
index 6ffa2514..c1e7d411 100644
--- a/backend/dvi/dvi-document.c
+++ b/backend/dvi/dvi-document.c
@@ -422,17 +422,17 @@ dvi_document_file_exporter_iface_init (EvFileExporterInterface *iface)
static gboolean
hsb2rgb (float h, float s, float v, guchar *red, guchar *green, guchar *blue)
{
- float i, f, p, q, t, r, g, b;
-
- if (h == 360)
- h = 0;
- else if ((h > 360) || (h < 0))
- return FALSE;
+ float f, p, q, t, r, g, b;
+ int i;
s /= 100;
v /= 100;
h /= 60;
i = floor (h);
+ if (i == 6)
+ i = 0;
+ else if ((i > 6) || (i < 0))
+ return FALSE;
f = h - i;
p = v * (1 - s);
q = v * (1 - (s * f));