Sha256: 4eb8f31429a73d6bb30a6a53a6ae5a15b638a97c8c45ed27152fd914759d7bc4
Contents?: true
Size: 1.16 KB
Versions: 2
Compression:
Stored size: 1.16 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,v 1.2.2.1 2005/08/25 03:38:05 austin Exp $ #++ 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pdf-writer-1.1.3 | demo/colornames.rb |
pdf-writer-1.1.2 | demo/colornames.rb |