#!/usr/bin/perl 

use PDF::API2::Lite;
use PDF::API2::Util;
use PDF::API2::Color;

$PDF::API2::Lite::useInternalFonts=1;

$pdf=PDF::API2::Lite->new;

$font=$pdf->corefont('Helvetica');

$pdf->page(595,842);
$pdf->print($font, 20, 100, 800, 0, 0, 'BarChart Example');

$pdf->strokecolor('black');

$pdf->linewidth(0.1);

$color=PDF::API2::Color->new('yellow');
$lum=1||$color->asLum;

#=============================================================

$color=PDF::API2::Color->new('red');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(100,700,10,50);
$pdf->fillstroke;

$color=PDF::API2::Color->new('yellow');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(150,700,10,50);
$pdf->fillstroke;

$color=PDF::API2::Color->new('white');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(200,700,10,50);
$pdf->fillstroke;

$color=PDF::API2::Color->new('brown');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(250,700,10,50);
$pdf->fillstroke;

$color=PDF::API2::Color->new('orange');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(300,700,10,50);
$pdf->fillstroke;

$color=PDF::API2::Color->new('green');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(350,700,10,50);
$pdf->fillstroke;

#=============================================================
$lum=0.7;


$color=PDF::API2::Color->new('red');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(100,650,10,50);
$pdf->fillstroke;

$color=PDF::API2::Color->new('yellow');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(150,650,10,50);
$pdf->fillstroke;

$color=PDF::API2::Color->new('white');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(200,650,10,50);
$pdf->fillstroke;

$color=PDF::API2::Color->new('brown');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(250,650,10,50);
$pdf->fillstroke;

$color=PDF::API2::Color->new('orange');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(300,650,10,50);
$pdf->fillstroke;

$color=PDF::API2::Color->new('green');
$color->setBrightness($lum);
$pdf->fillcolor($color->asHex);
$pdf->rect(350,650,10,50);
$pdf->fillstroke;

#=============================================================

$pdf->saveas("$0.pdf");

exit;

__END__
