Sha256: f444730b2b24677363444e8600388c4586db40cf1fbc5c980245d9777d882271

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 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$
#++
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

7 entries across 7 versions & 3 rubygems

Version Path
ypdf-writer-1.3.5 demo/colornames.rb
ypdf-writer-1.3.3 demo/colornames.rb
ypdf-writer-1.3.2 demo/colornames.rb
metaskills-pdf-writer-1.2.2 demo/colornames.rb
metaskills-pdf-writer-1.2.3 demo/colornames.rb
eventioz-pdf-writer-1.2.4 demo/colornames.rb
eventioz-pdf-writer-1.0 demo/colornames.rb