LB Booster
Programming >> Liberty BASIC language >> BackgroundColor$
http://lbb.conforums.com/index.cgi?board=lblang&action=display&num=1429815679

BackgroundColor$
Post by RNBW on Apr 23rd, 2015, 7:01pm

Is BackgroundColor$ limited to the standard colours listed in LB or can these be varied. What I am looking for is a pale cream background. The closest I can get to this is the garish yellow, which looks awful.

I tried BackgroundColor$ = "Backcolor R B G" (where R B & G are numbers 0-255). This changes the background colour but not in the way I expected.

Any ideas anyone?

Ray
Re: BackgroundColor$
Post by Alincon on Apr 23rd, 2015, 8:02pm

BackColor$ = r,g,b works for me in LBB. Wish it did in LB4

The color dialog can give you some number combinations to start with.
(click on the colors to reveal the combinations)

r.m.
Re: BackgroundColor$
Post by RNBW on Apr 23rd, 2015, 9:34pm

In LBB I've got BackgroundColor$ to work with:

BackgroundColor$ = "R B G"

I got the colour I was looking for with
BackgroundColor$ = "255 255 230"

Unfortunately, it doesn't seem to work in LB.

Yet another plus for LBB!!!

Ray
Re: BackgroundColor$
Post by Rod on Apr 23rd, 2015, 9:55pm

Just to clarify, the color triplet is R G B, not R B G as you have posted. Perhaps that is the color distortion you mention. And yes Liberty BASIC only supports named colors.
Re: BackgroundColor$
Post by RNBW on Apr 23rd, 2015, 10:15pm

Rod

You are correct. I'm afraid I was being a bit dyslectic. It is indeed RGB and that was why I was having the problem. The figures in my last post were in RGB order, not RBG as I stated.

It's a pity that LB can't do this. Is there no way it can be overcome?

Ray
Re: BackgroundColor$
Post by Rod on Apr 24th, 2015, 3:34pm

In the dim and distant past the controls on a GUI were supposed to adopt the colors that the user had chosen, not the programmer. So multi colored controls are new-fangled and largely I think driven by the browser experience folks have gained.

I believe that's historically why Liberty BASIC has more limited color abilities. But I am sure that will change.

The alternative is to roll your own in a graphic box where you can leave behind color, shape and transparency restrictions and code photorealistic controls of your own.

This is a silly example http://gamebin.webs.com/Daylight.zip