diff options
-rw-r--r-- | reselect | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -257,10 +257,20 @@ sub status_msg { } sub get_rend { - my ($self, $name, $default) = @_; - urxvt::SET_COLOR $default, - $self->my_resource("$name.foregroundColor") || urxvt::GET_BASEFG $default, - $self->my_resource("$name.backgroundColor") || urxvt::GET_BASEBG $default; + my ($self, $name, $rend) = @_; + # urxvt internal color indices are offset by 2 from the standard values + my $color_offset = 2; + + my $fg = $self->my_resource("$name.foregroundColor"); + if ($fg) { + $rend = urxvt::SET_FGCOLOR($rend, $color_offset + $fg); + } + my $bg = $self->my_resource("$name.backgroundColor"); + if ($bg) { + $rend = urxvt::SET_BGCOLOR($rend, $color_offset + $bg); + } + + return $rend; } sub on_key_release { |