/
lightxypad.kv
57 lines (45 loc) · 2.25 KB
/
lightxypad.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
#:kivy 1.4
<LightXyPad>:
hue: hue_w.value
hue_w: hue_w
value_type: 'alternate'
alt_value: [self.name.replace(" ", "_"), self.hsv[0], self.hsv[1], self.hsv[2]] if self.mode == 'hsv' else [self.name.replace(" ", "_"), self.rgb[0], self.rgb[1], self.rgb[2]]
args_pattern: "sfff"
path: "/" + self.app_name.replace(" ", "_") + "/LightXYPad/" + root.name.replace(" ", "_") + "/" + str(self.mode)
control_path: self.path
x_name: 'saturation'
y_name: 'value'
max: 1, 1
min: 0, 0
step: 0.001, 0.001
pad_pos: 60, 160
pad_size: root.width - 60, root.height - 160
hfader_pos: root.yfader_x + 10, root.y + root.xfader_y - root.hfader_height - 10
hfader_size: root.x + root.pad_x + root.pad_width - root.yfader_x - 10 , 50
canvas.before:
Color:
hsv: self.hue if isinstance(self.hue, float) else 0, 1, 1
Rectangle:
pos: root.x + root.pad_x + 1 + root.padding, root.y + root.pad_y + 1 + root.padding #self.x + self.subpad[0] + self.padding + 1 if self.x_sp_align == 'left' else self.x + self.padding, self.y + self.subpad[1] + self.padding + 1 if self.y_sp_align == 'bottom' else self.y + self.padding
size: root.pad_width - 2 - 2 * root.padding, root.pad_height - 2 - 2 * root.padding # self.width - self.subpad[0] - 2 * self.padding - 3, self.height - self.subpad[1] - 2 * self.padding - 3
Color:
rgb: 1, 1, 1
a: 1
Rectangle:
pos: root.hfader_x + 10, root.hfader_y + (root.hfader_height - 20) / 2
size: root.hfader_width - 21, 20
source: './data/teinte.png'
Rectangle:
pos: root.x + root.pad_x +1 + root.padding, root.y + root.pad_y + 1 + root.padding #self.x + self.subpad[0] + self.padding + 1, self.y + self.subpad[1] + self.padding + 1
size: root.pad_width - 2 - 2 * root.padding, root.pad_height - 2 - 2 * root.padding #self.width - self.subpad[0] - 2 * self.padding - 3, self.height - self.subpad[1] - 2 * self.padding - 3
source: './data/chroma.png'
ValueFader:
id: hue_w
name: 'hue'
color: (1, 1, 1)
size_hint: None, None
pos: root.hfader_pos
size: root.hfader_size
min: 0
max: 1
step: root.step[0]