Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #5733 > unrolled thread
| Started by | Richard Ashbery <basura@invalid.addr.uk> |
|---|---|
| First post | 2019-03-23 12:06 +0000 |
| Last post | 2019-03-26 11:31 +0000 |
| Articles | 5 — 2 participants |
Back to article view | Back to comp.sys.acorn.programmer
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
| From | Richard Ashbery <basura@invalid.addr.uk> |
|---|---|
| Date | 2019-03-23 12:06 +0000 |
| Subject | Small and Subtle colour change in animated object |
| Message-ID | <57993e68e7basura@invalid.addr.uk> |
MODE 1920,1080,8 : OFF
x = 0
REPEAT
CIRCLE FILL x,1100,100
x+=10
Z=INKEY(10)
UNTIL x=3800
This simple code draws a filled circle across screen. Has anyone got a
routine I could add to make each new circle go through a gradual
colour change? Only very small and subtle changes of colour are
required to cover the whole of the RGB spectrum. Routine would need to
handle thousands of colours because each prime colour has 256 possible
levels.
Richard
[toc] | [next] | [standalone]
| From | druck <news@druck.org.uk> |
|---|---|
| Date | 2019-03-24 21:40 +0000 |
| Message-ID | <15c1f69957.druck@druck.org.uk> |
| In reply to | #5733 |
On 23 Mar 2019 Richard Ashbery <basura@invalid.addr.uk> wrote:
> MODE 1920,1080,8 : OFF
> x = 0
> REPEAT
> CIRCLE FILL x,1100,100
> x+=10
> Z=INKEY(10)
> UNTIL x=3800
> This simple code draws a filled circle across screen. Has anyone got a
> routine I could add to make each new circle go through a gradual
> colour change? Only very small and subtle changes of colour are
> required to cover the whole of the RGB spectrum. 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
---druck
--
The ARM Club Free Software - http://www.armclub.org.uk/free/
32 bit Conversions Page - http://www.armclub.org.uk/32bit/
[toc] | [prev] | [next] | [standalone]
| From | Richard Ashbery <basura@invalid.addr.uk> |
|---|---|
| Date | 2019-03-25 13:48 +0000 |
| Message-ID | <579a4f6d54basura@invalid.addr.uk> |
| In reply to | #5734 |
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
[toc] | [prev] | [next] | [standalone]
| From | druck <news@druck.org.uk> |
|---|---|
| Date | 2019-03-25 20:26 +0000 |
| Message-ID | <q7bdhi$q7i$1@dont-email.me> |
| In reply to | #5735 |
On 25/03/2019 13:48, Richard Ashbery wrote: > 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. No worries. I was able to do it remotely via VNC to my ARMx6 minim. > 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. Yes, it was a simple cut & paste job, and can be expressed far more simply. > I can link your routine with a rather unusual but very effective > multi-pattern pseudo 'lissajous' program written in BB4W. Put it on some web space somewhere so we can all see it. ---druck
[toc] | [prev] | [next] | [standalone]
| From | Richard Ashbery <basura@invalid.addr.uk> |
|---|---|
| Date | 2019-03-26 11:31 +0000 |
| Message-ID | <579ac6bffcbasura@invalid.addr.uk> |
| In reply to | #5736 |
In article <q7bdhi$q7i$1@dont-email.me>, druck <news@druck.org.uk> wrote: [snip] > > I can link your routine with a rather unusual but very effective > > multi-pattern pseudo 'lissajous' program written in BB4W. > Put it on some web space somewhere so we can all see it. Unfortunately I'm without webspace at the moment. I've been too busy with other projects to sort out a new provider. I'll try and do that as soon as I've arranged webspace and got the program working properly. Regards Richard
[toc] | [prev] | [standalone]
Back to top | Article view | comp.sys.acorn.programmer
csiph-web