summaryrefslogtreecommitdiffstats
path: root/konversation/src/konversation-0.19-colors.pl
blob: 34a4918eea319dd28b1bf27ac6b2b36971b1c4f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /usr/bin/perl

use strict;

my $currentGroup = "";
my $key;
my $value;

while (<>)
{
    chomp;
    if ( /^\[/ )
    {
        $currentGroup = $_;
        next;
    }
    ($key, $value) = ($_ =~ /([^=]+)=[ \t]*([^\n]+)/);
    if ($value =~ /([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})$/)
    {
        print("# DELETE $currentGroup$key\n");
        printf("$key=%d,%d,%d\n",hex($1),hex($2),hex($3));
    }
}