unless (UNIVERSAL::isa($opts{fill}, 'Imager::Fill')) {
# assume it's a hash ref
require 'Imager/Fill.pm';
- $opts{fill} = Imager::Fill->new(%{$opts{fill}});
+ unless ($opts{fill} = Imager::Fill->new(%{$opts{fill}})) {
+ $self->{ERRSTR} = $Imager::ERRSTR;
+ return undef;
+ }
}
i_box_cfill($self->{IMG},$opts{xmin},$opts{ymin},$opts{xmax},
$opts{ymax},$opts{fill}{fill});
int ch;
i_fill_solid_t *fill = mymalloc(sizeof(i_fill_solid_t));
- if (combine && c->channel[3] < 1.0) {
+ if (combine) {
*fill = base_solid_fill_comb;
i_get_combine(combine, &fill->base.combine, &fill->base.combinef);
}
int ch;
i_fill_solid_t *fill = mymalloc(sizeof(i_fill_solid_t));
- if (combine && c->channel[3] < 255) {
+ if (combine) {
*fill = base_solid_fill_comb;
i_get_combine(combine, &fill->base.combine, &fill->base.combinef);
}
fill->bg = bg ? *bg : fcolor_to_color(fbg);
fill->ffg = ffg ? *ffg : color_to_fcolor(fg);
fill->fbg = fbg ? *fbg : color_to_fcolor(bg);
- if (combine && (fill->ffg.channel[0] < 1 || fill->fbg.channel[0] < 1)) {
+ if (combine) {
i_get_combine(combine, &fill->base.combine, &fill->base.combinef);
}
else {