Skip to content

EPS Colour channels for green and blue are swapped #10

Open
@GoogleCodeExporter

Description

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 [email protected] on 8 Feb 2012 at 11:33

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions