Colorizing List Fields

Jim Ault JimAultWins at yahoo.com
Sat Jun 23 13:13:16 EDT 2007


This technique should be a good choice and not deliver a speed hit, since
there cannot be more that a few fields where anyone would use the background
color of each line.

some extra steps that might help the look and feel:
   setting the border of the field behind to 0
   setting the left of the field behind further left because of margins
   setting the margin of both fields to 4

Of course, the scrolling field is more of a problem, so I  built a scrolling
group with both fields as non-scrolling, then set to the formattedheight of
the data field.

One extra touch is to set the blendLevel of the back field if the colors are
too intense.  I used a backing field set to gray50, did the line coloring
using the space runs, then set the blendlevel to 30.  Looks very readable.

I have quick built a working stack that does all of the above, if anyone is
interested.

Thanks, Ken :-)

Jim Ault
Las Vegas


On 6/23/07 6:40 AM, "Ken Ray" <kray at sonsothunder.com> wrote:

> On Sat, 23 Jun 2007 16:02:41 +1000, Sarah Reichelt wrote:
> 
>> However, the blue background for line 2 only covers the actual text,
>> it doesn't fill the line.
> 
> Right - to fill a complete line, my recommendation is to use two list
> fields; the one in front is transparent (opaque=false), and the one in
> back is opaque. For every line of text in the front field, make a line
> of text in the back field that is all spaces (all the way across and a
> little beyond the right margin of the back field). Then, set the
> HTMLText of any of the lines in the back field to the color you want as
> we've discssed previously. It's a bit of a hack, but it works...

> On Sat, 23 Jun 2007 16:02:41 +1000, Sarah Reichelt wrote:
I made a field and set the forecolor of mine 1 to red, and the
backcolor of line 2 to blue. This is what the htmlText of the field
then becomes.

<p><font color="#FF0000">Line 1</font></p>
<p><font bgcolor="#0000FF">Line 2</font></p>

However, the blue background for line 2 only covers the actual text,
it doesn't fill the line.





More information about the Use-livecode mailing list