Created
January 23, 2015 09:50
-
-
Save buty4649/dc4431c1bec9ef644627 to your computer and use it in GitHub Desktop.
ANSIカラーコードからIRCカラーコードに変換する奴
This file contains 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/env perl | |
use strict; | |
my @t = qw/1 5 3 7 2 6 10 14 15 4 9 8 12 13 11 0/; | |
while(<STDIN>) { | |
s/\e\[0m//g; | |
s/\e\[(\d\d)m/"\x03".$t[$1-30]/ge; | |
print; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment