Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #5735
| From | Richard Ashbery <basura@invalid.addr.uk> |
|---|---|
| Newsgroups | comp.sys.acorn.programmer |
| Subject | Re: Small and Subtle colour change in animated object |
| Date | 2019-03-25 13:48 +0000 |
| Organization | None |
| Message-ID | <579a4f6d54basura@invalid.addr.uk> (permalink) |
| References | <57993e68e7basura@invalid.addr.uk> <15c1f69957.druck@druck.org.uk> |
In article <15c1f69957.druck@druck.org.uk>, druck <news@druck.org.uk> wrote: > On 23 Mar 2019 Richard Ashbery <basura@invalid.addr.uk> wrote: [snip] > > Routine would need to > > handle thousands of colours because each prime colour has 256 possible > > levels. > Try this, it not my best code, but I'm really rusty in BBC BASIC. > As you want thousands of colours I've decreaed the increment to 2, to give > 1920 steps as opposed to 380 above. > ON ERROR PRINT REPORT$;" at line ";ERL:END > MODE 1920,1080,32 : OFF > x% = 0 > REPEAT > c = (x%/3800)*7 > i% = (c*256)MOD256 > d% = 255-i% > c% = c > CASE c% OF > WHEN 0 > r% = i% > g% = 0 > b% = 0 > WHEN 1 > r% = 255 > g% = i% > b% = 0 > WHEN 2 > r% = d% > g% = 255 > b% = 0 > WHEN 3 > r% = 0 > g% = 255 > b% = i% > WHEN 4 > r% = 0 > g% = d% > b% = 255 > WHEN 5 > r% = i% > g% = 0 > b% = 255 > WHEN 6 > r% = 255 > g% = i% > b% = 255 > ENDCASE > GCOL r%,g%,b% > CIRCLE FILL x%,1100,100 > x%+=2 > Z%=INKEY(10) > UNTIL x%>=3800 Many thanks Druck. I wish I could write a program as quickly as that! Works a treat - just the job. I see you use MODE 1920,1080,32 which makes a significant difference to the colour graduation smoothness. Presumably you've expanded the WHEN statements to make it clearer for me but by combining each r,g,b parameter group into each WHEN line almost halves the number of lines making routine quite compact. I can link your routine with a rather unusual but very effective multi-pattern pseudo 'lissajous' program written in BB4W. Thanks again Richard
Back to comp.sys.acorn.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Small and Subtle colour change in animated object Richard Ashbery <basura@invalid.addr.uk> - 2019-03-23 12:06 +0000
Re: Small and Subtle colour change in animated object druck <news@druck.org.uk> - 2019-03-24 21:40 +0000
Re: Small and Subtle colour change in animated object Richard Ashbery <basura@invalid.addr.uk> - 2019-03-25 13:48 +0000
Re: Small and Subtle colour change in animated object druck <news@druck.org.uk> - 2019-03-25 20:26 +0000
Re: Small and Subtle colour change in animated object Richard Ashbery <basura@invalid.addr.uk> - 2019-03-26 11:31 +0000
csiph-web