My rectangle is invisible when I instantiate it

I made a function to make rectangles representing shields appear across the bottom of the screen and be able to resize them as more are added, but whenever I create a rectangle its invisible. I tried deleting its image component and replacing it with that of a rectangle that actually shows, but it's still invisible. Here's a screenshot of the inspector:8324958--1093305--upload_2022-7-30_18-8-44.png
and here's the code in my function (i haven't gotten around to debugging it yet, just trying to get the rects to show):

    void onIncreaseMax(int amountIncrease)
    {
        amountofshields += amountIncrease;
        foreach (GameObject item in shields)
        {
            Destroy(item);
        }
        float widthpershield = shieldswidth / amountofshields;
        float shieldscenter = widthpershield / 2;
        List<Vector2> tospawns = new List<Vector2>();
        for (int i = 0; i < amountofshields; i++)
        {
            Vector2 toadd = new Vector2(shieldscenter, shieldsheight);
            tospawns.Add(toadd);
        }
        List<Vector2> sizes = new List<Vector2>();
        for (int i = 0; i < amountofshields; i++)
        {
            Vector2 toadd = new Vector2(widthpershield - spacebetween, segmentheight);
            sizes.Add(toadd);
        }
        for (int i = 0; i < amountofshields; i++)
        {
            shields.Add(Instantiate(shieldori, tospawns[i], Quaternion.identity));
        }
        int eye = 0;
        foreach (GameObject item in shields)
        {
            RectTransform rct = item.GetComponent<RectTransform>();
            rct.sizeDelta = sizes[eye];
            eye++;
        }
    }

Turns out I wasn't childing my rectangles to my canvas. whoops