Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Colored Patterns

A topic by chorkenbork created 28 days ago Views: 336 Replies: 8
Viewing posts 1 to 5

I was just wondering if it was possible to create patterns that use colors instead of black or white. I can't seem to find any info on that, but it would be great for making Apple II style graphics

(1 edit) (+2)

Even if you assign an 8,8 image to a pattern using the patterns interface, it gets turned into b/w. But, you can dynamically change what "b/w" means, which is what pink decker jam does.

(1 edit)

I wouldn't normally do this, but I'd like to request the ability to color patterns with the 16 color palletes as a future feature. I know he reads this. It'd be a the perfect fit for the ditherpunk aesthetic he's going for. it may be too advanced a feature for Lil

(+2)

I've had a thought about whether this could be achieved with custom brushes - like a brush that just draws a halftone pattern. I tried making a brush that just has a halftone pattern, and while you can kinda use it to stamp areas of dither, dragging with it makes the effect fall apart, and lining it up can be tricky. So it's not exactly a solution but let's call it an experiment.

You can try it yourself, by putting 

brush["ditherBrush" image["%%IMG0AAoACqqAVUCqgFVAqoBVQKqAVUCqgFVA"]]

into the listener.

Other thoughts I've had are whether an extra fill function would work - i.e. instead of filling every single pixel in the area it just fills half of them in the halftone pattern. This could probably be written as a function in a module maybe (i.e. pass it in an image and coordinates) but that's not as convenient as having it in the UI. But this might be easier to implement than reworking the way the patterns function? (Since the 1-bit nature of them may be difficult to change)

(+2)

So for what it's worth it looks like the new version 1.58 adds some features to the custom brushes, and includes some extra brushes in the "brushes.deck" file that basically do this but make it work - so you can use a brush that paints a halftone pattern.

I'm interested, but I don't think I fully understand how this works yet. I'm still stuck on how to use these codes exactly. but at least I know there's a way now!

(+3)

It's not too hard to set up. If you drag the "brushes.deck" onto an open Decker window, it'll pop the Font/Deck Accessory Mover up. If you then add the "screenPrints" module to your deck, then that'll add some extra brushes to the toolbar that paint like half-tone patterns that you can use for dithering.

Currently Decker seems to be able to draw with different brushes, but there's no difference at all in what's drawn, and this is discouraged by Decker switching away from the Fill tool on a change to the brush. So rather than an additional fill function, there's room in the design for the existing fill function to repeat the brush so drawing with different brushes would be useful.

Still, patterns also have animation and have this interesting effect: if you get a pattern into a canvas and move the canvas, the pattern reflects card coordinates rather than canvas coordinates. Paste this widget and move it around to see that:

%%WGT0{"w":[{"name":"canvas1","type":"canvas","size":[25,38],"pos":[282,72],"image":"%%IMG2ABkAJgAMGwUAExsHABIbBwASGwcADBsEAAIbCAAKGwYAARsIAAkbCAABGwcACRsIAAEbBwAJGwgAARsHAAkbCAABGwgACBsRAAgbEQAIGxEACBsSAAcbEgAHGxIABxsTAAYbCQABGwkABhsJAAEbCQAGGwkAARsJAAcbCAABGwoABhsTAAYbEwAGGxMABxsSAAcbEgAHGxIABxsSAAcbEgAIGwgAARsIAAgbCAABGwgACBsIAAEbCAAIGwgAAhsHAAkbBwADGwUAChsHAAQbAwAMGwUAFRsDACY="}],"d":{}}
(+2)

In the original HyperCard, if you picked a pattern (say, bricks) and filled an area, then picked another pattern (say diagonal lines) and clicked in the same place, only one brick would fill with diagonal lines: the pattern is converted to black-and-white pixels on the canvas, and that limits the next use of the flood tool.

In Decker, filling with diagonal lines replaces all the area that was filled with bricks, not just one brick.

That means the drawing tools aren’t drawing black-and-white pixels, they’re drawing pattern numbers, and sixty times a second Decker converts those pattern numbers into patterns of black-and-white pixels. Animated patterns would work by just changing which pattern to use on every consecutive frame.

As a result, the flood-fill tool works how childhood-me expected it to, and things like canvas.segment[] do the right thing with tiled dither patterns, instead of messing them up. However, it might also mean that “coloured patterns” are more difficult than you’d expect.