Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

hopefully updated icons

  • Loading branch information...
commit c0ba0ebe094bafa8bd9390459a21774fa5079a4c 1 parent 8632c10
nooodl authored
View
33 icons.rb
@@ -0,0 +1,33 @@
+require 'RMagick'
+include Magick
+$CGANAMES = %w(black blue green cyan red magenta brown lgray gray lblue lgreen lcyan lred lmagenta yellow white)
+
+def cga(cname)
+ n = $CGANAMES.index cname
+ c = Array.new(3) {|i| n[2-i] * 0xAA + n[3] * 0x55}
+ c[1] = 0x55 if n == 6
+ return c
+end
+
+def write_icon(filename, color, symbol)
+ color = cga(color) if color.is_a? String
+ r, g, b = *color
+ fg = "rgb(#{r>>0},#{g>>0},#{b>>0})"
+ bg = "rgb(#{r>>4},#{g>>4},#{b>>4})"
+
+ img = Image.new(50, 50) {self.background_color = bg}
+ Draw.new.annotate(img, 0, 0, 0, 0, symbol) {
+ self.font_family = 'DejaVu Sans Mono'
+ self.fill = fg
+ self.pointsize = 40
+ self.gravity = CenterGravity
+ }
+ img.border(2, 2, fg).write("./icons/#{filename}.png")
+end
+
+write_icon *$_.split while DATA.gets
+
+__END__
+old-ascension lgray <
+anti-stoner red x
+escapologist brown (
View
BIN  icons/anti-stoner.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  icons/escapologist.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1  icons/old-ascension.png
View
BIN  icons/old-ascension.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.