-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_icons.py
More file actions
75 lines (60 loc) 路 2.22 KB
/
Copy pathcreate_icons.py
File metadata and controls
75 lines (60 loc) 路 2.22 KB
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
71
72
73
74
75
#!/usr/bin/env python3
"""
Create icons for Dependency Confusion Hunter extension
Author: OFJAAAH
"""
from PIL import Image, ImageDraw, ImageFont
import os
def create_icon(size):
"""Create icon with specified size"""
# Create image with transparent background
img = Image.new('RGBA', (size, size), (0, 0, 0, 0))
draw = ImageDraw.Draw(img)
# Background circle
margin = size // 10
draw.ellipse([margin, margin, size-margin, size-margin],
fill=(255, 68, 68, 255))
# Inner circle
inner_margin = size // 4
draw.ellipse([inner_margin, inner_margin, size-inner_margin, size-inner_margin],
fill=(30, 30, 46, 255))
# Draw target symbol
center = size // 2
# Outer ring
ring_thickness = max(2, size // 32)
ring_radius = size // 3
draw.ellipse([center-ring_radius, center-ring_radius,
center+ring_radius, center+ring_radius],
outline=(255, 68, 68, 255), width=ring_thickness)
# Inner ring
small_ring_radius = size // 6
draw.ellipse([center-small_ring_radius, center-small_ring_radius,
center+small_ring_radius, center+small_ring_radius],
outline=(255, 68, 68, 255), width=ring_thickness)
# Center dot
dot_radius = size // 12
draw.ellipse([center-dot_radius, center-dot_radius,
center+dot_radius, center+dot_radius],
fill=(255, 68, 68, 255))
# Crosshair
line_length = size // 2.5
line_thickness = max(2, size // 32)
# Horizontal
draw.line([center-line_length, center, center+line_length, center],
fill=(255, 68, 68, 255), width=line_thickness)
# Vertical
draw.line([center, center-line_length, center, center+line_length],
fill=(255, 68, 68, 255), width=line_thickness)
return img
def main():
"""Create all icon sizes"""
icons_dir = '/root/PENTEST/confussedExtension/icons'
os.makedirs(icons_dir, exist_ok=True)
sizes = [16, 48, 128]
for size in sizes:
icon = create_icon(size)
icon.save(f'{icons_dir}/icon{size}.png', 'PNG')
print(f'Created icon{size}.png')
print('All icons created successfully!')
if __name__ == '__main__':
main()