-
Notifications
You must be signed in to change notification settings - Fork 1
ColorMask
Hubert Morawski edited this page Dec 27, 2018
·
4 revisions
Color Mask is used to simple make colorful objects.
- Colors are represented by numbers (0-9).
Note: Maybe in the future we will add more range and some editor.
- Space (' ') and blank ('\0') are used as alpha.
- Color mask should be same as
GameObjectContent. - Colors are translated by
Display.
-
0->Black -
1->Red -
2->Green -
3->Yellow -
4->Blue -
5->Magenta -
6->Cyan -
7->DarkYellow -
8->Gray -
9->White
Warning: Colors can look diffrent on diffrent terminal emulators.
- Color mask exmaple
Let's take a look a this Mario example.
We will use '█' block from ASCII. To make full pixel we need two blocks '██'. Now we can make something with it. Like Mario:
// It's me, Mario!
██████████
██████████████████
██████████████
████████████████████
██████████████████████
████████████████████
██████████████
██████████████
████████████████████
████████████████████████
████████████████████████
████████████████████████
████████████████████████
██████ ███████
██████ █████
████████ ███████
Now it's time to color our Mario. We will use color masks. So each character we will assign number (0-9) that will corresponds to colors. Let's see:
1111111111
111111111111111111
00000033330033
00330033333300333333
0033000033333300333333
00003333333300000000
33333333333333
11114411111111
11111144111144111111
111111114444444411111111
333311443344443344113333
333333444444444444333333
333344444444444444443333
444444 4444444
000000 00000
00000000 0000000
And voilà. It's Mario!
It's the same Mario but displayed using diffrent terminal color profiles. NOTE: Font is
Monospace, because "pixels" look nice.
And the same Mario in Windows Command Line:
- How diffrent colors looks on linux
Konsole(KDE Terminal emulator):