Update gift icon

This commit is contained in:
Ilya Laktyushin
2023-12-13 17:43:03 +04:00
parent b0358c28e8
commit 072a923df4
3 changed files with 329 additions and 27 deletions

View File

@@ -37,6 +37,7 @@ public struct PresentationResourcesSettings {
public static let deleteAccount = renderIcon(name: "Chat/Info/GroupRemovedIcon")
public static let powerSaving = renderIcon(name: "Settings/Menu/PowerSaving")
public static let stories = renderIcon(name: "Settings/Menu/Stories")
public static let premiumGift = renderIcon(name: "Settings/Menu/Gift")
public static let premium = generateImage(CGSize(width: 29.0, height: 29.0), contextGenerator: { size, context in
let bounds = CGRect(origin: CGPoint(), size: size)
@@ -64,34 +65,7 @@ public struct PresentationResourcesSettings {
drawBorder(context: context, rect: bounds)
})
public static let premiumGift = generateImage(CGSize(width: 29.0, height: 29.0), contextGenerator: { size, context in
let bounds = CGRect(origin: CGPoint(), size: size)
context.clear(bounds)
let path = UIBezierPath(roundedRect: bounds, cornerRadius: 7.0)
context.addPath(path.cgPath)
context.clip()
let colorsArray: [CGColor] = [
UIColor(rgb: 0x3da3f4).cgColor,
UIColor(rgb: 0x3da3f4).cgColor,
UIColor(rgb: 0x39b3b9).cgColor,
UIColor(rgb: 0x35c37c).cgColor,
UIColor(rgb: 0x35c37c).cgColor
]
var locations: [CGFloat] = [0.0, 0.15, 0.5, 0.85, 1.0]
let gradient = CGGradient(colorsSpace: deviceColorSpace, colors: colorsArray as CFArray, locations: &locations)!
context.drawLinearGradient(gradient, start: CGPoint(x: 0.0, y: 0.0), end: CGPoint(x: size.width, y: size.height), options: CGGradientDrawingOptions())
if let image = generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Gift"), color: UIColor(rgb: 0xffffff)), let cgImage = image.cgImage {
context.draw(cgImage, in: CGRect(origin: CGPoint(x: floorToScreenPixels((bounds.width - image.size.width) / 2.0), y: floorToScreenPixels((bounds.height - image.size.height) / 2.0)), size: image.size))
}
drawBorder(context: context, rect: bounds)
})
public static let passport = renderIcon(name: "Settings/Menu/Passport")
public static let watch = renderIcon(name: "Settings/Menu/Watch")

View File

@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "gifting.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,316 @@
%PDF-1.7
1 0 obj
<< /Length 2 0 R
/Range [ 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 ]
/Domain [ 0.000000 1.000000 ]
/FunctionType 4
>>
stream
{ 0.203922 exch 0.780392 exch 0.434510 exch dup 0.000000 gt { exch pop exch pop exch pop dup 0.000000 sub 0.035731 mul 0.203922 add exch dup 0.000000 sub -0.149692 mul 0.780392 add exch dup 0.000000 sub 0.557157 mul 0.434510 add exch } if dup 1.000000 gt { exch pop exch pop exch pop 0.239653 exch 0.630700 exch 0.991667 exch } if pop }
endstream
endobj
2 0 obj
337
endobj
3 0 obj
<< /Length 4 0 R
/Range [ 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 ]
/Domain [ 0.000000 1.000000 ]
/FunctionType 4
>>
stream
{ 0.415686 exch 0.576471 exch 0.996078 exch dup 0.000000 gt { exch pop exch pop exch pop dup 0.000000 sub 0.219303 mul 0.415686 add exch dup 0.000000 sub -0.182753 mul 0.576471 add exch dup 0.000000 sub 0.007310 mul 0.996078 add exch } if dup 0.536458 gt { exch pop exch pop exch pop dup 0.536458 sub 0.372241 mul 0.533333 add exch dup 0.536458 sub -0.109980 mul 0.478431 add exch dup 0.536458 sub -0.160740 mul 1.000000 add exch } if dup 1.000000 gt { exch pop exch pop exch pop 0.705882 exch 0.427451 exch 0.925490 exch } if pop }
endstream
endobj
4 0 obj
533
endobj
5 0 obj
<< /Type /XObject
/Length 6 0 R
/Group << /Type /Group
/S /Transparency
>>
/Subtype /Form
/Resources << /Pattern << /P2 << /Matrix [ -23.499998 -32.500000 32.500000 -23.499998 -22.161621 66.797729 ]
/Shading << /Coords [ 0.000000 0.000000 1.000000 0.000000 ]
/ColorSpace /DeviceRGB
/Function 1 0 R
/Domain [ 0.000000 1.000000 ]
/ShadingType 2
/Extend [ true true ]
>>
/PatternType 2
/Type /Pattern
>>
/P1 << /Matrix [ -38.500000 -39.500000 39.500000 -38.500000 -18.718872 88.820923 ]
/Shading << /Coords [ 0.000000 0.000000 1.000000 0.000000 ]
/ColorSpace /DeviceRGB
/Function 3 0 R
/Domain [ 0.000000 1.000000 ]
/ShadingType 2
/Extend [ true true ]
>>
/PatternType 2
/Type /Pattern
>>
>> >>
/BBox [ 0.000000 0.000000 29.000000 29.000000 ]
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
/Pattern cs
/P1 scn
0.000000 22.000000 m
0.000000 25.865993 3.134007 29.000000 7.000000 29.000000 c
22.000000 29.000000 l
25.865993 29.000000 29.000000 25.865993 29.000000 22.000000 c
29.000000 7.000000 l
29.000000 3.134007 25.865993 0.000000 22.000000 0.000000 c
7.000000 0.000000 l
3.134007 0.000000 0.000000 3.134007 0.000000 7.000000 c
0.000000 22.000000 l
h
f
n
Q
q
1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
/Pattern cs
/P2 scn
0.000000 22.000000 m
0.000000 25.865993 3.134007 29.000000 7.000000 29.000000 c
22.000000 29.000000 l
25.865993 29.000000 29.000000 25.865993 29.000000 22.000000 c
29.000000 7.000000 l
29.000000 3.134007 25.865993 0.000000 22.000000 0.000000 c
7.000000 0.000000 l
3.134007 0.000000 0.000000 3.134007 0.000000 7.000000 c
0.000000 22.000000 l
h
f
n
Q
q
1.000000 0.000000 -0.000000 1.000000 8.008423 19.410034 cm
1.000000 1.000000 1.000000 scn
5.487308 -0.000037 m
4.038543 -0.000037 l
3.300339 -0.000037 2.727271 0.186985 2.319340 0.561030 c
1.911410 0.935076 1.707445 1.374228 1.707445 1.878488 c
1.707445 2.371884 1.871824 2.758302 2.200583 3.037742 c
2.529341 3.317182 2.955014 3.456902 3.477600 3.456902 c
4.031750 3.456902 4.505239 3.262461 4.898067 2.873578 c
5.290895 2.484696 5.487308 1.962934 5.487308 1.308291 c
5.487308 -0.000037 l
7.292006 -0.000037 l
7.292006 1.308291 l
7.292006 1.962934 7.364071 2.484696 7.757265 2.873578 c
8.150458 3.262461 8.626795 3.456902 9.186275 3.456902 c
9.702904 3.456902 10.125415 3.317182 10.453808 3.037742 c
10.782201 2.758302 10.946398 2.371884 10.946398 1.878488 c
10.946398 1.374228 10.742589 0.935076 10.334972 0.561030 c
9.927355 0.186985 9.354445 -0.000037 8.616240 -0.000037 c
7.292006 -0.000037 l
11.774800 -0.000037 l
12.047695 0.253551 12.262582 0.550418 12.419462 0.890565 c
12.576343 1.230711 12.654782 1.603575 12.654782 2.009155 c
12.654782 2.604348 12.505219 3.133906 12.206090 3.597829 c
11.906961 4.061752 11.505851 4.424632 11.002758 4.686469 c
10.499664 4.948305 9.936552 5.079224 9.313420 5.079224 c
8.627056 5.079224 8.017799 4.904222 7.485651 4.554217 c
6.953501 4.204213 6.568957 3.709132 6.332016 3.068975 c
6.095076 3.709132 5.708990 4.204213 5.173757 4.554217 c
4.638525 4.904222 4.027778 5.079224 3.341518 5.079224 c
2.724344 5.079224 2.162722 4.948305 1.656649 4.686469 c
1.150577 4.424632 0.747951 4.061752 0.448770 3.597829 c
0.149590 3.133906 0.000000 2.604348 0.000000 2.009155 c
0.000000 1.603575 0.078440 1.230711 0.235320 0.890565 c
0.392201 0.550418 0.607140 0.253551 0.880139 -0.000037 c
5.487308 -0.000037 l
h
f
n
Q
q
1.000000 0.000000 -0.000000 1.000000 5.357300 5.266113 cm
1.000000 1.000000 1.000000 scn
8.122711 14.161255 m
1.205217 14.161255 l
0.539594 14.161255 0.000000 13.621661 0.000000 12.956038 c
0.000000 10.545603 l
0.000000 9.879980 0.539594 9.340385 1.205217 9.340385 c
1.657174 9.340385 l
2.392273 9.340419 l
2.392273 9.347366 l
8.122711 9.347366 l
8.122711 14.161255 l
h
8.122711 7.837366 m
4.000076 7.837366 l
4.000741 7.833856 l
1.807826 7.833864 l
1.807826 2.410386 l
1.807826 1.079140 2.887015 -0.000049 4.218261 -0.000049 c
8.122711 -0.000049 l
8.122711 7.837366 l
h
9.942711 2.473686 m
9.942711 7.837366 l
14.091056 7.837366 l
14.090375 7.833766 l
16.119783 7.833864 l
16.171423 7.833864 16.221849 7.839061 16.270567 7.848959 c
16.270435 2.410386 l
16.270435 1.079140 15.191247 -0.000049 13.860001 -0.000049 c
9.943045 -0.000049 l
9.943045 2.453600 l
9.943045 2.460312 9.942933 2.467008 9.942711 2.473686 c
h
9.942711 9.347366 m
9.942711 11.568908 l
9.942932 11.572248 9.943045 11.575619 9.943045 11.579016 c
9.943045 14.161255 l
16.873045 14.161255 l
17.538668 14.161255 18.078262 13.621661 18.078262 12.956038 c
18.078262 10.545603 l
18.078262 9.879980 17.538668 9.340385 16.873045 9.340385 c
16.270435 9.340385 l
16.270567 9.325291 l
16.221849 9.335190 16.171423 9.340385 16.119783 9.340385 c
15.392273 9.340496 l
15.392273 9.347366 l
9.942711 9.347366 l
h
f*
n
Q
endstream
endobj
6 0 obj
4009
endobj
7 0 obj
<< /Type /XObject
/Length 8 0 R
/Group << /Type /Group
/S /Transparency
>>
/Subtype /Form
/Resources << >>
/BBox [ 0.000000 0.000000 29.000000 29.000000 ]
>>
stream
/DeviceRGB CS
/DeviceRGB cs
q
1.000000 0.000000 -0.000000 1.000000 0.000000 0.000000 cm
0.000000 0.000000 0.000000 scn
0.000000 22.000000 m
0.000000 25.865993 3.134007 29.000000 7.000000 29.000000 c
22.000000 29.000000 l
25.865993 29.000000 29.000000 25.865993 29.000000 22.000000 c
29.000000 7.000000 l
29.000000 3.134007 25.865993 0.000000 22.000000 0.000000 c
7.000000 0.000000 l
3.134007 0.000000 0.000000 3.134007 0.000000 7.000000 c
0.000000 22.000000 l
h
f
n
Q
endstream
endobj
8 0 obj
468
endobj
9 0 obj
<< /XObject << /X1 5 0 R >>
/ExtGState << /E1 << /SMask << /Type /Mask
/G 7 0 R
/S /Alpha
>>
/Type /ExtGState
>> >>
>>
endobj
10 0 obj
<< /Length 11 0 R >>
stream
/DeviceRGB CS
/DeviceRGB cs
q
/E1 gs
/X1 Do
Q
endstream
endobj
11 0 obj
46
endobj
12 0 obj
<< /Annots []
/Type /Page
/MediaBox [ 0.000000 0.000000 29.000000 29.000000 ]
/Resources 9 0 R
/Contents 10 0 R
/Parent 13 0 R
>>
endobj
13 0 obj
<< /Kids [ 12 0 R ]
/Count 1
/Type /Pages
>>
endobj
14 0 obj
<< /Pages 13 0 R
/Type /Catalog
>>
endobj
xref
0 15
0000000000 65535 f
0000000010 00000 n
0000000531 00000 n
0000000553 00000 n
0000001270 00000 n
0000001292 00000 n
0000007085 00000 n
0000007108 00000 n
0000007824 00000 n
0000007846 00000 n
0000008144 00000 n
0000008248 00000 n
0000008270 00000 n
0000008446 00000 n
0000008522 00000 n
trailer
<< /ID [ (some) (id) ]
/Root 14 0 R
/Size 15
>>
startxref
8583
%%EOF