Sha256: ab3e7e722d84327769ad8fb3ba9f231ee7c776a15bf8ffd0e7220434e34d2dc7
Contents?: true
Size: 1.15 KB
Versions: 4
Compression:
Stored size: 1.15 KB
Contents
#-- # PDF::Writer for Ruby. # http://rubyforge.org/projects/ruby-pdf/ # Copyright 2003 - 2005 Austin Ziegler. # # Licensed under a MIT-style licence. See LICENCE in the main distribution # for full licensing information. # # $Id: colornames.rb 134 2005-08-25 03:38:06Z austin $ #++ begin require 'pdf/writer' rescue LoadError => le if le.message =~ %r{pdf/writer$} $LOAD_PATH.unshift("../lib") require 'pdf/writer' else raise end end require 'color/rgb/metallic' pdf = PDF::Writer.new pdf.start_columns 4 colours = Color::RGB.constants.sort colours.each do |colour| next if colour == "PDF_FORMAT_STR" next if colour == "Metallic" pdf.fill_color Color::RGB.const_get(colour) pdf.text colour, :font_size => 24 pdf.fill_color Color::RGB::Black pdf.text colour, :font_size => 12, :justification => :center end colours = Color::RGB::Metallic.constants.sort colours.each do |colour| pdf.fill_color Color::RGB::Metallic.const_get(colour) pdf.text colour, :font_size => 24 pdf.fill_color Color::RGB::Black pdf.text colour, :font_size => 12, :justification => :center end pdf.save_as "colornames.pdf"
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
pdf-writer-1.1.5 | demo/colornames.rb |
pdf-writer-1.1.6 | demo/colornames.rb |
pdf-writer-1.1.7 | demo/colornames.rb |
pdf-writer-1.1.8 | demo/colornames.rb |