简体   繁体   中英

Adaptive Icon shapes path

This is how Launcher3 defines icon shape path.

<string-array translatable="false" name="icon_shape_override_paths_values">
    <item>M50,0L100,0 100,100 0,100 0,0z</item>
    <item>M50,0 C10,0 0,10 0,50 0,90 10,100 50,100 90,100 100,90 100,50 100,10 90,0 50,0 Z</item>
    <item>M50 0A50 50,0,1,1,50 100A50 50,0,1,1,50 0</item>
    <item>M50,0A50,50,0,0 1 100,50 L100,85 A15,15,0,0 1 85,100 L50,100 A50,50,0,0 1 50,0z</item>
</string-array>

These correspond to square, squircle, circle and teardrop accordingly.

Now I wonder how can I create my own shape like this. I want to draw a hexagon.

Try something like:

<item>M 50,0 L 100,25, 100,75, 50,100, 0,75, 0,25 Z</item>

Example:

 svg { background: linen; } 
 <svg width="100" height="100"> <path d="M 50,0 L 100,25, 100,75, 50,100, 0,75, 0,25 Z"/> </svg> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM