diff --git a/MD_STD.php b/MD_STD.php index 14451c3..69b475e 100644 --- a/MD_STD.php +++ b/MD_STD.php @@ -465,4 +465,18 @@ final class MD_STD { return \levenshtein($str1, $str2); } + + /** + * Converts a string to color codes. + * + * @param string $str Input string. + * + * @return string + */ + public static function string_to_color_code(string $str):string { + + $code = substr(dechex(crc32($str)), 0, 6); + return $code; + + } }