{
  "format": "whimtex.layers",
  "version": 1,
  "canvas": {
    "width": 512,
    "height": 512
  },
  "layers": [
    {
      "type": "group",
      "name": "Heart",
      "properties": {
        "compositing": "Isolated"
      },
      "children": [
        {
          "type": "sdf",
          "name": "Rimlight",
          "properties": {
            "opacity": 0.4,
            "clippingMask": true,
            "distancePosition": "Inside",
            "maxDistance": 19.8,
            "gradient": [
              {
                "time": 0,
                "color": [1, 0.714147866, 0.635294139, 1]
              },
              {
                "time": 1,
                "color": [1, 0.635294139, 0.7029992, 0]
              }
            ]
          },
          "transform": {
            "position": [1.77459717, 7.9291687],
            "scale": [1.06605351, 1.03097332]
          },
          "target": "heart-shape"
        },
        {
          "type": "blur",
          "name": "Highlight Glow · Gaussian",
          "properties": {
            "clippingMask": true,
            "blur": {
              "strength": 3.17299986,
              "radius": 58.5
            }
          },
          "target": "highlights"
        },
        {
          "type": "group",
          "id": "highlights",
          "name": "Highlight · Ellipses",
          "properties": {
            "clippingMask": true,
            "compositing": "Isolated"
          },
          "children": [
            {
              "type": "shape",
              "name": "Large Highlight",
              "properties": {
                "shape": {
                  "kind": "Ellipse",
                  "fillColor": [1, 0.9, 0.87, 0.62]
                }
              },
              "transform": {
                "position": [-117, 112],
                "scale": [0.055, 0.1],
                "rotation": -35
              }
            },
            {
              "type": "shape",
              "name": "Small Highlight",
              "properties": {
                "shape": {
                  "kind": "Ellipse",
                  "fillColor": [1, 0.9, 0.87, 0.62]
                }
              },
              "transform": {
                "position": [-85, 134],
                "scale": [0.033, 0.033]
              }
            }
          ]
        },
        {
          "type": "gradient",
          "name": "Pink → Raspberry · Clipping",
          "properties": {
            "clippingMask": true,
            "gradient": [
              {
                "time": 0,
                "color": [0.56, 0.035, 0.18, 1]
              },
              {
                "time": 0.2399939,
                "color": [0.83, 0.06, 0.25, 1]
              },
              {
                "time": 0.6,
                "color": [1, 0.24, 0.39, 1]
              },
              {
                "time": 1,
                "color": [1, 0.65, 0.66, 1]
              }
            ]
          }
        },
        {
          "type": "color",
          "id": "heart-shape",
          "name": "Heart Shape",
          "fx": [
            {
              "name": "Heart Shape FX",
              "code": "// @param float _HeartWidth = 1 [0.65 .. 1.25]\n// @param float _NotchDepth = 1 [0.35 .. 1.8]\n// @param float _TipLength = 1 [0.65 .. 1.3]\n// @param float _Fullness = 1 [0.25 .. 1.8]\n\nfloat2 HeartCurve(float2 a, float2 b, float2 c, float2 d, float t)\n{\n    float s = 1-t;\n    return s*s*s*a + 3*s*s*t*b + 3*s*t*t*c + t*t*t*d;\n}\nvoid HeartEdge(float2 p, float2 a, float2 b, inout float distanceSq, inout float crossings)\n{\n    float2 e=b-a, v=p-a;\n    float2 nearPoint=v-e*saturate(dot(v,e)/max(dot(e,e),0.000001));\n    distanceSq=min(distanceSq,dot(nearPoint,nearPoint));\n    if ((a.y>p.y)!=(b.y>p.y))\n    {\n        float x=a.x+(p.y-a.y)*(b.x-a.x)/(b.y-a.y);\n        if(x>p.x)crossings+=1;\n    }\n}\nvoid HeartArc(float2 p, float2 a, float2 b, float2 c, float2 d, inout float distanceSq, inout float crossings)\n{\n    float2 previous=a;\n    [unroll] for(int i=1;i<=20;i++)\n    {\n        float2 next=HeartCurve(a,b,c,d,i/20.0);\n        HeartEdge(p,previous,next,distanceSq,crossings);\n        previous=next;\n    }\n}\nfloat4 ApplyFX(float2 uv, float4 color)\n{\n    uv = LayerToLocal(uv);\n    float2 p=float2(abs(uv.x*512-256),(1-uv.y)*512);\n    float d=1000000, crossings=0;\n    // Shape controls move the curve anchors, keeping symmetry and smooth joins.\n    float width = _HeartWidth;\n    float notch = 96.0 + 62.0 * _NotchDepth;\n    float tip = 178.0 + 229.0 * _TipLength;\n    HeartArc(p, float2(0,notch), float2(22*width,96+21*_NotchDepth),\n        float2(62*width,96), float2(95*width,96), d,crossings);\n    HeartArc(p, float2(95*width,96), float2(144*width,96),\n        float2(180*width,131), float2(180*width,178), d,crossings);\n    HeartArc(p, float2(180*width,178), float2(180*width,178+88*_TipLength),\n        float2(79*width*_Fullness,178+164*_TipLength), float2(0,tip), d,crossings);\n    float signedDistance=sqrt(d)*(fmod(crossings,2)>0.5?-1:1);\n    float aa=max(fwidth(signedDistance), 0.0001);\n    color.a*=saturate(0.5-signedDistance/aa);\n    return color;\n}"
            }
          ]
        },
        {
          "type": "outline",
          "name": "Raspberry Outline",
          "properties": {
            "color": [0.38, 0.055, 0.14, 1],
            "metric": "EuclideanAntialiased",
            "outlineWidth": 25.41,
            "outlineSoftness": 0.65,
            "fillCenter": true,
            "fillColor": [0.38, 0.055, 0.14, 1]
          },
          "target": "heart-shape"
        }
      ]
    }
  ]
}
