Skip to content

Instantly share code, notes, and snippets.

@trapd00r
Created January 12, 2012 11:26
Show Gist options
  • Save trapd00r/1599967 to your computer and use it in GitHub Desktop.
Save trapd00r/1599967 to your computer and use it in GitHub Desktop.
#!/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