Advertisement
Muzer

xchat nick colour coe

Mar 20th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. static char rcolors[] = { 19, 20, 22, 24, 25, 26, 27, 28, 29 };
  2.  
  3. static int
  4. color_of (char *name)
  5. {
  6.         int i = 0, sum = 0;
  7.  
  8.         while (name[i])
  9.                 sum += name[i++];
  10.         sum %= sizeof (rcolors) / sizeof (char);
  11.         return rcolors[sum];
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement