Exemplo n.º 1
0
function toner_to_colour($descr, $percent)
{
    if (substr($descr, -1) == 'C' || toner_map($descr, "cyan")) {
        $colour['left'] = "B6F6F6";
        $colour['right'] = "33B4B1";
    }
    if (substr($descr, -1) == 'M' || toner_map($descr, "magenta")) {
        $colour['left'] = "FBA8E6";
        $colour['right'] = "D028A6";
    }
    if (substr($descr, -1) == 'Y' || toner_map($descr, "yellow")) {
        $colour['left'] = "FFF764";
        $colour['right'] = "DDD000";
    }
    if (substr($descr, -1) == 'K' || toner_map($descr, "black")) {
        $colour['left'] = "888787";
        $colour['right'] = "555555";
    }
    if (!isset($colour['left'])) {
        $colour = get_percentage_colours(100 - $percent);
        $colour['found'] = FALSE;
    } else {
        $colour['found'] = TRUE;
    }
    return $colour;
}
function toner2colour($descr, $percent)
{
    $colour = get_percentage_colours(100 - $percent);
    if (substr($descr, -1) == 'C' || toner_map($descr, "cyan")) {
        $colour['left'] = "55D6D3";
        $colour['right'] = "33B4B1";
    }
    if (substr($descr, -1) == 'M' || toner_map($descr, "magenta")) {
        $colour['left'] = "F24AC8";
        $colour['right'] = "D028A6";
    }
    if (substr($descr, -1) == 'Y' || toner_map($descr, "yellow")) {
        $colour['left'] = "FFF200";
        $colour['right'] = "DDD000";
    }
    if (substr($descr, -1) == 'K' || toner_map($descr, "black")) {
        $colour['left'] = "111111";
        $colour['right'] = "555555";
    }
    return $colour;
}