-
Notifications
You must be signed in to change notification settings - Fork 5
/
chevron.yaml
66 lines (63 loc) · 2.25 KB
/
chevron.yaml
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
styles:
lines-chevron:
doc:
author:
name: Patricio Gonzalez Vivo
twitter: patriciogv
version: 0.0.1
tangram-version: 0.0.7
licence: MIT
description: |
Apply a chevron pattern to a line
ui:
shaders:
defines:
CHEVRON_SCALE:
type: number
label: Scale
range:
min: 0.
max: 10.
step: 0.1
CHEVRON_SIZE:
type: number
label: Size
range:
min: 0.
max: 10.
step: 0.1
CHEVRON_COLOR:
type: color
label: Color
CHEVRON_ALPHA:
type: number
label: Alpha
range:
min: 0.
max: 1.
step: 0.01
CHEVRON_BACKGROUND_COLOR:
type: color
label: 'Background color'
CHEVRON_BACKGROUND_ALPHA:
type: number
label: Background alpha
range:
min: 0.
max: 1.
step: 0.01
base: lines
texcoords: true
shaders:
defines:
CHEVRON_COLOR: color.rgb*.5
CHEVRON_ALPHA: 1.
CHEVRON_BACKGROUND_COLOR: color.rgb
CHEVRON_BACKGROUND_ALPHA: color.a
CHEVRON_SIZE: 1.
CHEVRON_SCALE: 1.
blocks:
color: |
color = mix(vec4(CHEVRON_BACKGROUND_COLOR, CHEVRON_BACKGROUND_ALPHA),
vec4(CHEVRON_COLOR, CHEVRON_ALPHA),
step(.5,fract((v_texcoord.y+abs(v_texcoord.x-.5)) * CHEVRON_SCALE)*CHEVRON_SIZE));