#!/usr/bin/perl use strict; use RTF::Writer; my $output = 'c:/temp/colortext.rtf'; my $rtf = RTF::Writer->new_to_file($output); $rtf->prolog( 'title' => "Color Test", 'colors' => [ undef, [255,0,0], # 1-red [0,255,0], # 2-green [0,0,255], # 3-blue [255,128,0], # 4-orange ], ); $rtf->paragraph( \'\cf1',"This is Red" ); $rtf->paragraph( \'\cf2',"This is Green" ); $rtf->paragraph( \'\cf3',"This is Blue" ); $rtf->paragraph( \'\cf4',"This is Orange" ); $rtf->close;