use JSON -support_by_pp;
#
+# List of foreground colors. This list is not complete, it just
+# contains the colors needed by videosite.
+#
+# The % are doubled because these are used in sprintf.
+#
+my %foreground_colors = (
+ 'magenta' => '%%m',
+ '*magenta' => '%%M',
+ '*yellow' => '%%Y',
+ '*green' => '%%G',
+ '*red' => '%%R',
+ 'default' => '%%n',
+);
+
+#
# Initialize the config subsystem. Called by the core.
#
# Due to historic reasons this has to deal with a number of possible config sources:
#
# Return a color code. Called by the core
#
+# Does not handle background colors yet.
+#
sub colorpair {
my ($fg, $bg) = @_;
- Irssi::print(sprintf("Asked to convert (%s,%s) into irssi color codes", $fg, $bg));
+ $fg = exists($foreground_colors{$fg})?$foreground_colors{$fg}:'';
+ $bg = '';
- return '';
+ return $fg . $bg;
}
#