repl.it
@Battlesquid/

termpix

Python

Another attempt at making a library to do graphics in the terminal.

fork
loading
Files
  • main.py
  • DemoAssets
  • README.txt
  • shapeconv.py
  • termpix.py
  • Packager files
  • requirements.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from termpix import Map, rgb_to_hex
from random import randint
import shapeconv, sys, math

"""
To see the library I made that this is using, go to termpix.py
Please keep in mind that this is a work in progress.
If it doesn't work for you, you could have the wrong Internet Browser 
(I am using Google Chrome)

A Project by RobertoBean.
"""

#DEMOS

Surf = Map(30, 30, cooldown=1)
red_sqaure = shapeconv.get_vecs("DemoAssets/Red.shp")
orange_sqaure = shapeconv.get_vecs("DemoAssets/Orange.shp")
yellow_sqaure = shapeconv.get_vecs("DemoAssets/Yellow.shp")
green_sqaure = shapeconv.get_vecs("DemoAssets/Green.shp")
blue_sqaure = shapeconv.get_vecs("DemoAssets/Blue.shp")
indigo_sqaure = shapeconv.get_vecs("DemoAssets/Indigo.shp")
violet_sqaure = shapeconv.get_vecs("DemoAssets/Violet.shp")

Surf.clear()
Surf.polygon(*red_sqaure, auto=True, outline="#F00")
Surf.polygon(*orange_sqaure, auto=True, outline="#F80")
Surf.polygon(*yellow_sqaure, auto=True, outline="#FF0")
Surf.polygon(*green_sqaure, auto=True, outline="#0F0")
Surf.polygon(*blue_sqaure, auto=True, outline="#00F")
Surf.polygon(*indigo_sqaure, auto=True, outline="#80F")
Surf.polygon(*violet_sqaure, auto=True, outline="#F0F")
Surf.display(clear = False)

input("Press Enter to continue...")
Surf.clear()

pentagon = shapeconv.get_vecs("DemoAssets/Pentagon.shp")

Surf.polygon(*square, auto=True, outline="#F00")
Surf.display()

input("Press Enter to continue...")
Surf.clear()

for x in range(100):
  Surf[randint(0, 29), randint(0, 29)] = rgb_to_hex(
    randint(0, 255),
    randint(0, 255),
    randint(0, 255)
  )

Surf.display()
input("Press Enter to continue...")

Surf.clear()
Surf.image("DemoAssets/fortnite.jfif")
Surf.display()

input("Press Enter to continue...")

Surf.clear()
Surf.contrast_image("DemoAssets/fortnite.jpg", 0.5)
Surf.display()