Hi and good day!
Found this script on php.net
basically, HEX colour codes to "web safe" colours...
Would anyone offer insight on this idea....
The ouput of a query is a text blob . The text is content, paragraphs etc..
with a few words in the blob being color coded
ex.
Some text <font color=#616161>some colored text</font> and more and more..
The idea .
grab each similair "#616161>" with regex Im guessing
always a 6 character color code
Loop Using :
function color_mkwebsafe ( $in )
{
// put values into an easy-to-use array
$vals['r'] = hexdec( substr($in, 0, 2) );
$vals['g'] = hexdec( substr($in, 2, 2) );
$vals['b'] = hexdec( substr($in, 4, 2) );
// loop through
foreach( $vals as $val )
{
// convert value
$val = ( round($val/51) * 51 );
// convert to HEX
$out .= str_pad(dechex($val), 2, '0', STR_PAD_LEFT);
}
return $out;
}
I have not attempted any functions, because this might not be do able.
The text blog contain many "font color="