1 package Xchat::XPI::Utils;
8 use lib get_info 'xchatdir';
9 use Xchat::XPI qw<register init>;
11 our $VERSION = '0.02';
14 my ($nick, $col) = ($_[0], 0);
15 $col += ord for split //, $nick;
16 my @rcolors = (nickcmp(get_info('version'), '2.4.0') < 0)
17 ? (3, 4, 6, 8, 9, 10, 11, 12, 13)
18 : (19, 20, 22, 24, 25, 26, 27, 28, 29);
20 return sprintf "\003%d%s", $rcolors[$col], $nick;
23 use base qw<Exporter>;
26 our %EXPORT_TAGS = ('funcs' => [ qw<dye_nick> ]);
27 our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
28 $EXPORT_TAGS{'all'} = [ @EXPORT_OK ];