ergunresul / zend-framework-matrixcode-module

Automatically exported from code.google.com/p/zend-framework-matrixcode-module
0 stars 0 forks source link

EPS Colour channels for green and blue are swapped #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Creating an EPS with a foreground colour that has a different value for the 
green and blue channels will produce the wrong colour:

Here is a patch:

Index: Matrixcode/Renderer/Eps.php
===================================================================
--- Matrixcode/Renderer/Eps.php (revision 11)
+++ Matrixcode/Renderer/Eps.php (working copy)
@@ -80,8 +80,8 @@
        $back_color = $this->_matrixcode->getBackgroundColor();
        // convert a hexadecimal color code into decimal eps format (green = 0 1 0, blue = 0 0 1, ...)
        $r = round((($fore_color & 0xFF0000) >> 16) / 255, 5);
-       $b = round((($fore_color & 0x00FF00) >> 8) / 255, 5);
-       $g = round(($fore_color & 0x0000FF) / 255, 5);
+       $g = round((($fore_color & 0x00FF00) >> 8) / 255, 5);
+       $b = round(($fore_color & 0x0000FF) / 255, 5);
        $fore_color = $r.' '.$g.' '.$b;

        $output = 

Original issue reported on code.google.com by c...@caff.cx on 8 Feb 2012 at 11:33