Ticket #1222 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

Setting Foreground / Background color via Attributes on pango layout does not work

Reported by: guest Owned by: axel
Priority: normal Milestone: 0.12.0
Component: Pango bindings Version: 0.11.0
Keywords: layoutSetAttributes Cc: marc.lisp@…

Description

Hello,

I'm trying to set foreground and background color for a pango layout, unfortunately it does not seem to work.

If I do something like layoutSetAttributes lay [AttrForeground? 0 (-1) (Color 255 0 0),

AttrBackground? 0 (-1) (Color 255 255 255)]

then foreground and background is black (black rectangles are displayed), if I only set the foreground using layoutSetAttributes lay [AttrForeground? 0 (-1) (Color 255 0 0) then the foreground color is always black (not red), if I set the background to whatever value, using layoutSetAttributes lay [AttrBackground? 0 (-1) (Color 255 0 0) foreground and background is always black. To test this with the associated source, modify line 34 or 35 . Maybe I'm dooing something wrong, if so what is the correct way to set foreground and background color.

Attachments

Main.hs (2.2 kB) - added by guest 4 years ago.
Example code illustrating the problem

Change History

Changed 4 years ago by guest

Example code illustrating the problem

Changed 4 years ago by guest

I found the problem, it was a error in my code, I forget that a color is defined in 2 byte words so I should have used 65535 instead of 255. You may consider this bugreport closed

Changed 4 years ago by axel

  • status changed from new to closed
  • resolution set to invalid
Note: See TracTickets for help on using tickets.