-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgui.kv
70 lines (70 loc) · 2.14 KB
/
gui.kv
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
66
67
68
69
70
# coding=utf-8
<Base>:
hex_input: hex_input
kivy_input: kivy_input
slider: slider
back_color: 0, 0, 0, 1
orientation: "vertical"
canvas:
Color:
rgba: root.back_color
Rectangle:
size: self.size
pos: self.pos
BoxLayout:
id: box
size_hint: None, None
size: 460, 150
pos_hint: {"center_x": .5, "center_y": .5}
GridLayout:
size_hint_x: .9
pos_hint: {"center": (.5, .5)}
rows: 2
Label:
size_hint_x: .2
text: "Hex Values"
TextInput:
id: hex_input
size_hint_x: .4
multiline: False
padding_x: "10dp"
padding_y: (self.height - self.line_height) * .5
on_text_validate: root.calc_hex(self.text)
Button:
id: hex_btn
size_hint_x: .4
text: "Calculate Kivy Values"
on_press: root.calc_hex(hex_input.text)
Label:
size_hint_x: .2
text: "Kivy Values"
TextInput:
id: kivy_input
size_hint_x: .4
multiline: False
padding_x: "10dp"
padding_y: (self.height - self.line_height) * .5
on_text_validate: root.calc_kivy(self.text)
Button:
id: kivy_btn
size_hint_x: .4
text: "Calculate Hex Values"
on_press: root.calc_kivy(kivy_input.text)
BoxLayout:
orientation: "vertical"
size_hint_x: .1
Label:
size_hint_y: .1
text: "Alpha"
Slider:
id: slider
size_hint_y: .8
orientation: "vertical"
range: 0, 1
step: .05
value: .5
padding: sp(18)
on_value: root.on_slider(hex_input.text, kivy_input.text)
Label:
size_hint_y: .1
text: "{:.2f}".format(slider.value)