함수 str2rgb()

Jmnote (토론 | 기여)님의 2018년 1월 29일 (월) 02:29 판 (Jmnote님이 함수 StringToRgb() 문서를 함수 string2rgb() 문서로 이동했습니다)
StringToRGB()
string2color
string to color

1 PHP

function stringToRgb( $str ) {
  $code = dechex(crc32(md5($str)));
  $r = hexdec(substr($code,0,2))/2+127;
  $g = hexdec(substr($code,2,2))/2+127;
  $b = hexdec(substr($code,4,2))/2+127;
  return dechex($r).dechex($g).dechex($b);
}

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}