Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #5735

Re: Small and Subtle colour change in animated object

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Richard Ashbery <basura@invalid.addr.uk>
Newsgroups comp.sys.acorn.programmer
Subject Re: Small and Subtle colour change in animated object
Date Mon, 25 Mar 2019 13:48:35 +0000 (GMT)
Organization None
Lines 73
Message-ID <579a4f6d54basura@invalid.addr.uk> (permalink)
References <57993e68e7basura@invalid.addr.uk> <15c1f69957.druck@druck.org.uk>
X-Trace individual.net /nXd1ajNyIEGT0nu9lD/CAkJzoZxYkupQ87aqR6w31MXNQByrg
X-Orig-Path uwclub.net!richard.ashbery
Cancel-Lock sha1:JOUVzRBxCQdsZYIHiTPmk1Q0LFg=
User-Agent Pluto/3.16 (RISC OS/5.25) NewsHound/v1.52-32
Xref csiph.com comp.sys.acorn.programmer:5735

Show key headers only | View raw


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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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