Created
January 12, 2012 11:26
-
-
Save trapd00r/1599967 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings FATAL => 'all'; | |
use vars qw($VERSION); | |
use Term::ExtendedColor::Xresources qw(get_xterm_color set_xterm_color); | |
my $colors = get_xterm_color( | |
{ | |
index => [0..255], | |
type => 'hex', | |
}, | |
); | |
for my $c(sort { $a <=> $b } keys %{ $colors }) { | |
#print "\e[48;5;${c}m \e[m"; | |
my $hex = sprintf("%6x", eval "0x$colors->{$c}->{rgb} + $c"); | |
set_xterm_color( | |
{ | |
$c => $hex, | |
}, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment