Author |
Topic: FILL (replacing a colour at specific location) (Read 340 times) |
|
michael
Senior Member
member is offline


Posts: 335
|
 |
FILL (replacing a colour at specific location)
« Thread started on: Nov 6th, 2016, 11:32pm » |
|
I could be wrong, but I find that if I FILL a location that has a color other than black, it wont fill the area with the new color. Is there a way to force it to fill until it reaches a different color, or is there another way?
If FILL doesn't work that way, then I will work on a PAINT tool that does that.
|
|
Logged
|
I like making program generators and like reinventing the wheel
|
|
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: FILL (replacing a colour at specific location)
« Reply #1 on: Nov 7th, 2016, 08:40am » |
|
Hi Michael,
The manual says "performs a 'flood fill' in the current graphics foreground colour, starting at the specified point and continuing until non-background-colour pixels are found"
In other words, if your background colour is black, it will only fill black pixels.
If you change the background colour to the colour you are trying to fill over, it should work: here's an example Code: MODE 21
GCOL 1
RECTANGLE FILL 100,100,500,200
GCOL 4
RECTANGLE 100,500,500,200
GCOL 2
FILL 200,600
WAIT 100
GCOL 3
REM This should fail
FILL 200,200
REM But this should work....
GCOL 128+1 :REM Set background to the red of the bottom rectangle
GCOL 7
FILL 200,200
If you don't know in advance what colour it will have, you could check with POINT.
Best wishes,
D
|
|
Logged
|
|
|
|
michael
Senior Member
member is offline


Posts: 335
|
 |
Re: FILL (replacing a colour at specific location)
« Reply #2 on: Nov 7th, 2016, 09:21am » |
|
I see what I was doing wrong. Thanks..
I will work on this. It will require using TINT since I am using palettes.
|
|
Logged
|
I like making program generators and like reinventing the wheel
|
|
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: FILL (replacing a colour at specific location)
« Reply #3 on: Nov 7th, 2016, 11:06am » |
|
Yes, you may need to use TINT to get the physical colour, then map that to a logical colour, and set it as the background.
D
|
|
Logged
|
|
|
|
|