Thornton 2 dot Com
1K617

GEOS Fill Patterns

Ariel's GEOS Programmer's Reference Guide
Back: Glossary Up: Contents Next: Programming Notes (TODO)

Table of Contents

  1. Fill Patterns Accessible by SetPattern
  2. Fill Patterns Inaccessible by SetPattern

GEOS has 34 fill patterns built in, each a 1-bit monochrome 8x8 tile. (By consequence, each pattern is stored in 8 bytes.) These fill patterns are used by routines like Rectangle, GraphicsString, and their inline counterparts to fill in a region of the screen. The variable curPattern holds a pointer to the first byte of the current fill pattern, and the pattern is chosen by giving the number to SetPattern.

GEOS draws each pattern aligned to 8-pixel boundaries. If you draw a filled rectangle, for example, from (2,2) to (15,15), then GEOS will draw the whole pattern tile in the (8,8)-(15,15) square, and clipped pattern tiles in the (0,0)-(7,7), (8,0)-(15,7), and (0,8)-(7,15) squares. As a consequence, drawing overlapping filled rectangles will result in the filled tile patterns always lining up throughout the combined region whether the rectangle edges are on 8-pixel boundaries or not.

Due to a bug in the GEOS Kernal, only the first 32 of these patterns (0-31) can be chosen by SetPattern. Patterns 32 and 33 can only be chosen by first setting pattern 31, then adding 8 or 16 to curPattern.

GEOS will let any program replace the system patterns with new pattern definitions, and the new patterns will persist in every program run until the computer is turned off (including in geoPaint and deskTop). However, the next time GEOS is booted, the patterns will revert to their defaults.

In Apple GEOS, the pattern definitions are kept in auxiliary high memory and shouldn't be accessed directly. Instead, GetPattern should be used to retrieve a pattern definition, and SetUserPattern should be used to redefine a system pattern. Apple GEOS also provides a 35th pattern slot (number 34) reserved specifically for a custom fill pattern definition.

The 34 built-in patterns are given in the tables below. The pattern tile is shown in both ASCII art and graphical form, and the bytes defining the pattern are shown in binary, decimal, and hexadecimal forms. The graphical representation consists of three tiles:

The graphical representations presume black pixels on white backgrounds.

Fill Patterns Accessible by SetPattern

# Image Pattern
in ASCII Art
Image Pattern Example Tiles
Image Pattern Data in Binary
Image Pattern Data in Decimal
Image Pattern Data in Hexadecimal
0
. . . . . . . . 
. . . . . . . . 
. . . . . . . . 
. . . . . . . . 
. . . . . . . . 
. . . . . . . . 
. . . . . . . . 
. . . . . . . . 
pattern 0
Binary: %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000
Decimal: 0, 0, 0, 0, 0, 0, 0, 0
Hex: $00 $00 $00 $00 $00 $00 $00 $00
1
[][][][][][][][]
[][][][][][][][]
[][][][][][][][]
[][][][][][][][]
[][][][][][][][]
[][][][][][][][]
[][][][][][][][]
[][][][][][][][]
pattern 1
Binary: %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111
Decimal: 255, 255, 255, 255, 255, 255, 255, 255
Hex: $ff $ff $ff $ff $ff $ff $ff $ff
2
[]. []. []. []. 
. []. []. []. []
[]. []. []. []. 
. []. []. []. []
[]. []. []. []. 
. []. []. []. []
[]. []. []. []. 
. []. []. []. []
pattern 2
Binary: %10101010 %01010101 %10101010 %01010101 %10101010 %01010101 %10101010 %01010101
Decimal: 170, 85, 170, 85, 170, 85, 170, 85
Hex: $aa $55 $aa $55 $aa $55 $aa $55
3
[]. . [][]. . []
. []. . . . []. 
. . []. . []. . 
[]. . [][]. . []
[]. . [][]. . []
. . []. . []. . 
. []. . . . []. 
[]. . [][]. . []
pattern 3
Binary: %10011001 %01000010 %00100100 %10011001 %10011001 %00100100 %01000010 %10011001
Decimal: 153, 66, 36, 153, 153, 36, 66, 153
Hex: $99 $42 $24 $99 $99 $24 $42 $99
4
[][][][][]. [][]
[][][][]. []. []
[][][][][]. [][]
[][][][]. []. []
[][][][][]. [][]
[][][][]. []. []
[][][][][]. [][]
[][][][]. []. []
pattern 4
Binary: %11111011 %11110101 %11111011 %11110101 %11111011 %11110101 %11111011 %11110101
Decimal: 251, 245, 251, 245, 251, 245, 251, 245
Hex: $fb $f5 $fb $f5 $fb $f5 $fb $f5
5
[]. . . []. . . 
. . []. . . []. 
[]. . . []. . . 
. . []. . . []. 
[]. . . []. . . 
. . []. . . []. 
[]. . . []. . . 
. . []. . . []. 
pattern 5
Binary: %10001000 %00100010 %10001000 %00100010 %10001000 %00100010 %10001000 %00100010
Decimal: 136, 34, 136, 34, 136, 34, 136, 34
Hex: $88 $22 $88 $22 $88 $22 $88 $22
6
. [][][]. [][][]
[][]. [][][]. []
. [][][]. [][][]
[][]. [][][]. []
. [][][]. [][][]
[][]. [][][]. []
. [][][]. [][][]
[][]. [][][]. []
pattern 6
Binary: %01110111 %11011101 %01110111 %11011101 %01110111 %11011101 %01110111 %11011101
Decimal: 119, 221, 119, 221, 119, 221, 119, 221
Hex: $77 $dd $77 $dd $77 $dd $77 $dd
7
[]. . . []. . . 
. . . . . . . . 
. . []. . . []. 
. . . . . . . . 
[]. . . []. . . 
. . . . . . . . 
. . []. . . []. 
. . . . . . . . 
pattern 7
Binary: %10001000 %00000000 %00100010 %00000000 %10001000 %00000000 %00100010 %00000000
Decimal: 136, 0, 34, 0, 136, 0, 34, 0
Hex: $88 $00 $22 $00 $88 $00 $22 $00
8
. [][][]. [][][]
[][][][][][][][]
[][]. [][][]. []
[][][][][][][][]
. [][][]. [][][]
[][][][][][][][]
[][]. [][][]. []
[][][][][][][][]
pattern 8
Binary: %01110111 %11111111 %11011101 %11111111 %01110111 %11111111 %11011101 %11111111
Decimal: 119, 255, 221, 255, 119, 255, 221, 255
Hex: $77 $ff $dd $ff $77 $ff $dd $ff
9
[][][][][][][][]
. . . . . . . . 
[][][][][][][][]
. . . . . . . . 
[][][][][][][][]
. . . . . . . . 
[][][][][][][][]
. . . . . . . . 
pattern 9
Binary: %11111111 %00000000 %11111111 %00000000 %11111111 %00000000 %11111111 %00000000
Decimal: 255, 0, 255, 0, 255, 0, 255, 0
Hex: $ff $00 $ff $00 $ff $00 $ff $00
10
. []. []. []. []
. []. []. []. []
. []. []. []. []
. []. []. []. []
. []. []. []. []
. []. []. []. []
. []. []. []. []
. []. []. []. []
pattern 10
Binary: %01010101 %01010101 %01010101 %01010101 %01010101 %01010101 %01010101 %01010101
Decimal: 85, 85, 85, 85, 85, 85, 85, 85
Hex: $55 $55 $55 $55 $55 $55 $55 $55
11
. . . . . . . []
. . . . . . []. 
. . . . . []. . 
. . . . []. . . 
. . . []. . . . 
. . []. . . . . 
. []. . . . . . 
[]. . . . . . . 
pattern 11
Binary: %00000001 %00000010 %00000100 %00001000 %00010000 %00100000 %01000000 %10000000
Decimal: 1, 2, 4, 8, 16, 32, 64, 128
Hex: $01 $02 $04 $08 $10 $20 $40 $80
12
[]. . . . . . . 
. []. . . . . . 
. . []. . . . . 
. . . []. . . . 
. . . . []. . . 
. . . . . []. . 
. . . . . . []. 
. . . . . . . []
pattern 12
Binary: %10000000 %01000000 %00100000 %00010000 %00001000 %00000100 %00000010 %00000001
Decimal: 128, 64, 32, 16, 8, 4, 2, 1
Hex: $80 $40 $20 $10 $08 $04 $02 $01
13
[][][][][][][]. 
[][][][][][]. []
[][][][][]. [][]
[][][][]. [][][]
[][][]. [][][][]
[][]. [][][][][]
[]. [][][][][][]
. [][][][][][][]
pattern 13
Binary: %11111110 %11111101 %11111011 %11110111 %11101111 %11011111 %10111111 %01111111
Decimal: 254, 253, 251, 247, 239, 223, 191, 127
Hex: $fe $fd $fb $f7 $ef $df $bf $7f
14
. [][][][][][][]
[]. [][][][][][]
[][]. [][][][][]
[][][]. [][][][]
[][][][]. [][][]
[][][][][]. [][]
[][][][][][]. []
[][][][][][][]. 
pattern 14
Binary: %01111111 %10111111 %11011111 %11101111 %11110111 %11111011 %11111101 %11111110
Decimal: 127, 191, 223, 239, 247, 251, 253, 254
Hex: $7f $bf $df $ef $f7 $fb $fd $fe
15
[][][][][][][][]
[]. . . []. . . 
[]. . . []. . . 
[]. . . []. . . 
[][][][][][][][]
[]. . . []. . . 
[]. . . []. . . 
[]. . . []. . . 
pattern 15
Binary: %11111111 %10001000 %10001000 %10001000 %11111111 %10001000 %10001000 %10001000
Decimal: 255, 136, 136, 136, 255, 136, 136, 136
Hex: $ff $88 $88 $88 $ff $88 $88 $88
16
[][][][][][][][]
[]. . . . . . . 
[]. . . . . . . 
[]. . . . . . . 
[]. . . . . . . 
[]. . . . . . . 
[]. . . . . . . 
[]. . . . . . . 
pattern 16
Binary: %11111111 %10000000 %10000000 %10000000 %10000000 %10000000 %10000000 %10000000
Decimal: 255, 128, 128, 128, 128, 128, 128, 128
Hex: $ff $80 $80 $80 $80 $80 $80 $80
17
[][][][][][][][]
[]. . . . . . . 
[]. . . . . . . 
[]. . . . . . . 
[][][][][][][][]
. . . . []. . . 
. . . . []. . . 
. . . . []. . . 
pattern 17
Binary: %11111111 %10000000 %10000000 %10000000 %11111111 %00001000 %00001000 %00001000
Decimal: 255, 128, 128, 128, 255, 8, 8, 8
Hex: $ff $80 $80 $80 $ff $08 $08 $08
18
. . . . []. . . 
. . . [][][]. . 
. . []. . . []. 
[][]. . . . . []
[]. . . . . . . 
. . . . . . . []
. . . . . . []. 
. . . . . []. . 
pattern 18
Binary: %00001000 %00011100 %00100010 %11000001 %10000000 %00000001 %00000010 %00000100
Decimal: 8, 28, 34, 193, 128, 1, 2, 4
Hex: $08 $1c $22 $c1 $80 $01 $02 $04
19
[]. . . []. . . 
. . . []. []. . 
. . []. . . []. 
. []. . . . . []
[]. . . []. . . 
. . . . . . . . 
[]. []. []. []. 
. . . . . . . . 
pattern 19
Binary: %10001000 %00010100 %00100010 %01000001 %10001000 %00000000 %10101010 %00000000
Decimal: 136, 20, 34, 65, 136, 0, 170, 0
Hex: $88 $14 $22 $41 $88 $00 $aa $00
20
[]. . . . . . . 
. []. . . . . . 
. . []. . . . . 
. . . . . . . . 
. . . . . . []. 
. . . . . []. . 
. . . . []. . . 
. . . . . . . . 
pattern 20
Binary: %10000000 %01000000 %00100000 %00000000 %00000010 %00000100 %00001000 %00000000
Decimal: 128, 64, 32, 0, 2, 4, 8, 0
Hex: $80 $40 $20 $00 $02 $04 $08 $00
21
. []. . . . . . 
[]. []. . . . . 
. . . . . . . . 
. . . . . . . . 
. . . . . []. . 
. . . . []. []. 
. . . . . . . . 
. . . . . . . . 
pattern 21
Binary: %01000000 %10100000 %00000000 %00000000 %00000100 %00001010 %00000000 %00000000
Decimal: 64, 160, 0, 0, 4, 10, 0, 0
Hex: $40 $a0 $00 $00 $04 $0a $00 $00
22
[]. . . . . []. 
. []. . . []. . 
. . [][][]. . []
. []. . . []. . 
[]. . . . . []. 
. . . . . . . []
. . . . . . . []
. . . . . . . []
pattern 22
Binary: %10000010 %01000100 %00111001 %01000100 %10000010 %00000001 %00000001 %00000001
Decimal: 130, 68, 57, 68, 130, 1, 1, 1
Hex: $82 $44 $39 $44 $82 $01 $01 $01
23
. . . . . . [][]
[]. . . . []. . 
. []. . []. . . 
. . [][]. . . . 
. . . . [][]. . 
. . . . . . []. 
. . . . . . . []
. . . . . . . []
pattern 23
Binary: %00000011 %10000100 %01001000 %00110000 %00001100 %00000010 %00000001 %00000001
Decimal: 3, 132, 72, 48, 12, 2, 1, 1
Hex: $03 $84 $48 $30 $0c $02 $01 $01
24
[][][][][]. . . 
. [][][]. []. . 
. . []. . . []. 
. []. . . [][][]
[]. . . [][][][]
. . . []. [][][]
. . []. . . []. 
. [][][]. . . []
pattern 24
Binary: %11111000 %01110100 %00100010 %01000111 %10001111 %00010111 %00100010 %01110001
Decimal: 248, 116, 34, 71, 143, 23, 34, 113
Hex: $f8 $74 $22 $47 $8f $17 $22 $71
25
[]. . . . . . . 
[]. . . . . . . 
. []. . . . . []
. . [][][][][]. 
. . . . []. . . 
. . . . []. . . 
. . . []. []. . 
[][][]. . . [][]
pattern 25
Binary: %10000000 %10000000 %01000001 %00111110 %00001000 %00001000 %00010100 %11100011
Decimal: 128, 128, 65, 62, 8, 8, 20, 227
Hex: $80 $80 $41 $3e $08 $08 $14 $e3
26
. []. []. []. []
[]. []. . . . . 
. []. . . . . . 
. []. . . . . . 
. []. []. []. []
. . . . []. []. 
. . . . . []. . 
. . . . . []. . 
pattern 26
Binary: %01010101 %10100000 %01000000 %01000000 %01010101 %00001010 %00000100 %00000100
Decimal: 85, 160, 64, 64, 85, 10, 4, 4
Hex: $55 $a0 $40 $40 $55 $0a $04 $04
27
. . . []. . . . 
. . []. . . . . 
. []. []. []. . 
[]. []. []. []. 
[][][][][][][][]
. . . . . . []. 
. . . . . []. . 
. . . . []. . . 
pattern 27
Binary: %00010000 %00100000 %01010100 %10101010 %11111111 %00000010 %00000100 %00001000
Decimal: 16, 32, 84, 170, 255, 2, 4, 8
Hex: $10 $20 $54 $aa $ff $02 $04 $08
28
. . []. . . . . 
. []. []. . . . 
[]. . . []. . . 
[]. . . []. . . 
[]. . . []. . . 
[]. . . []. . . 
. . . . . []. []
. . . . . . []. 
pattern 28
Binary: %00100000 %01010000 %10001000 %10001000 %10001000 %10001000 %00000101 %00000010
Decimal: 32, 80, 136, 136, 136, 136, 5, 2
Hex: $20 $50 $88 $88 $88 $88 $05 $02
29
. [][][]. [][][]
[]. . . []. . []
[]. . . [][][][]
[]. . . [][][][]
. [][][]. [][][]
[]. . [][]. . . 
[][][][][]. . . 
[][][][][]. . . 
pattern 29
Binary: %01110111 %10001001 %10001111 %10001111 %01110111 %10011000 %11111000 %11111000
Decimal: 119, 137, 143, 143, 119, 152, 248, 248
Hex: $77 $89 $8f $8f $77 $98 $f8 $f8
30
[]. [][][][][][]
. . . . . . . . 
[]. [][][][][][]
[]. [][][][][][]
[]. [][]. . . . 
[]. [][]. . . . 
[]. [][]. . . . 
[]. [][]. . . . 
pattern 30
Binary: %10111111 %00000000 %10111111 %10111111 %10110000 %10110000 %10110000 %10110000
Decimal: 191, 0, 191, 191, 176, 176, 176, 176
Hex: $bf $00 $bf $bf $b0 $b0 $b0 $b0
31
. . . . . . . . 
. . . . []. . . 
. . . []. []. . 
. . []. []. []. 
. []. []. []. []
. . []. []. []. 
. . . []. []. . 
. . . . []. . . 
pattern 31
Binary: %00000000 %00001000 %00010100 %00101010 %01010101 %00101010 %00010100 %00001000
Decimal: 0, 8, 20, 42, 85, 42, 20, 8
Hex: $00 $08 $14 $2a $55 $2a $14 $08

Fill Patterns Inaccessible by SetPattern

Due to a bug in the GEOS Kernal, only the first 32 patterns (0-31) can be chosen by SetPattern. Patterns 32 and 33 below can only be chosen by first setting pattern 31, then adding 8 or 16 to curPattern.

# Image Pattern
in ASCII Art
Image Pattern Example Tiles
Image Pattern Data in Binary
Image Pattern Data in Decimal
Image Pattern Data in Hexadecimal
32
[]. [][]. . . []
. . [][]. . . . 
. . . . . . [][]
. . . [][]. [][]
[][]. [][]. . . 
[][]. . . . . . 
. . . . [][]. . 
[]. . . [][]. []
pattern 32
Binary: %10110001 %00110000 %00000011 %00011011 %11011000 %11000000 %00001100 %10001101
Decimal: 177, 48, 3, 27, 216, 192, 12, 141
Hex: $b1 $30 $03 $1b $d8 $c0 $0c $8d
33
[]. . . . . . . 
. . . []. . . . 
. . . . . . []. 
. . []. . . . . 
. . . . . . . []
. . . . []. . . 
. []. . . . . . 
. . . . . []. . 
pattern 33
Binary: %10000000 %00010000 %00000010 %00100000 %00000001 %00001000 %01000000 %00000100
Decimal: 128, 16, 2, 32, 1, 8, 64, 4
Hex: $80 $10 $02 $20 $01 $08 $40 $04
34 Exists in Apple GEOS only, and reserved for custom pattern definition with SetUserPattern.