-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlitehtml-t-web_color.py
executable file
·44 lines (37 loc) · 1.04 KB
/
litehtml-t-web_color.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
#!/usr/bin/env vpython3
import sys
import logme
from litehtmlpy import litehtml, litehtmlpy
#litehtmlpy.debuglog(1)
class document_container(litehtml.document_container):
pass
class Main:
def main(self):
if len(sys.argv) > 1:
fname = sys.argv[1]
else:
fname = 'demo.html'
fname = 'litehtmlt.html'
html = open(fname, 'rt').read()
cntr = document_container()
try:
self.demo(cntr)
finally:
del cntr
def demo(self, cntr):
wc00 = litehtmlpy.web_color()
print(wc00)
wcff = litehtmlpy.web_color(0xff, 0xff, 0xff)
print(wcff)
print(wc00==wcff)
print(wc00!=wcff)
print('black', litehtmlpy.web_color.black)
print('white', litehtmlpy.web_color.white)
print('transparent', litehtmlpy.web_color.transparent)
print('current', litehtmlpy.web_color.current_color)
wcffd = wcff.darken(0.5)
print(wcffd)
def main():
app = Main()
app.main()
main()