Strings Php

function build_color($red, $green, $blue) {
    $redhex   = dechex($red);
    $greenhex = dechex($green);
    $bluehex  = dechex($blue);
    return sprintf('#%02s%02s%02s', $redhex, $greenhex, $bluehex);
}