/*
hex2rgb.mrc by hantu (contact me at #helpdesk, dalnet)
$hex2rgb() is used to convert html's hex color code to rgb values
this snippet is also a demonstration on mirc 6.17's $regsubex
usage:
- $hex2rgb(#FFFFFF) returns 16777215
- $hex2rgb(#0000FF).rgb returns 255,0,0
oh yes, # is optional.
if the input is invalid, it will return the original input.
credit:
- hixxy, for improving my lame regular expression pattern :)
*/
alias hex2rgb { return $regsubex($1-,/#?([0-9A-Fa-f]{6})/,$iif($prop == rgb,$rgb($base(\t,16,10)),$base(\t,16,10))) }