# Alpha

## Introduction

`Alpha` controls an instance's transparency. A fully opaque instance has an `Alpha` of 255. A fully transparent instance has an `Alpha` of 0.

<figure><img src="/files/7znfrOMyXNiRAxHX9Zr7" alt=""><figcaption><p>Sprites with Alpha of 255, 200, 150, 100, 50, and 0</p></figcaption></figure>

An object's transparency is a combination of its `Alpha`, [Blend](/gum/gum-tool/gum-elements/general-properties/blend.md), and its [Source File](/gum/gum-tool/gum-elements/sprite/source-file.md). Skia elements may also have transparent portions due to their shape (such as [ColoredCircle](/gum/gum-tool/gum-elements/skia-standard-elements/coloredcircle.md) and [RoundedRectangle](/gum/gum-tool/gum-elements/skia-standard-elements/roundedrectangle.md)) as well as [dropshadows](/gum/gum-tool/gum-elements/skia-standard-elements/general-properties/has-dropshadow.md).

## Alpha and Children

By default the Alpha property affects the selected instance only - it does not cascade down to its children. For example, the following shows a parent white ColoredRectangle with a child blue ColoredRectangle. If the white ColoredRectangle's `Alpha` property changes, the BlueRectangle's opacity does not change.

<figure><img src="/files/5bK5qHlvjlh9G3lmCDTJ" alt=""><figcaption><p>Parent Alpha does not change child opacity</p></figcaption></figure>

A parent can affect its children's transparency if the parent is a container with `Is Render Target` set to true. For example, if the white rectangle is added to a Container, the Container can make its entire contents transparent.

<figure><img src="/files/36PvpsSVettzjT80mtMs" alt=""><figcaption><p>Entire Container Alpha makes all children transparent</p></figcaption></figure>

Note that by setting Is Render Target to true, the entire container's Alpha can be adjusted rather rather than the alpha value cascading to each individual child. This Alpha value is used to control transparency *after* all children have been drawn. We can see the difference between a partially-transparent Container and each child individually being made partially transparent by overlapping two children ColoredRectangles.

The rectangles on the left each have an `Alpha` value of `255`. These rectangles are in a Container `Is Render Target` set to true and an `Alpha` set to `128`.

The rectangles on the right each have an `Alpha` of `128`, so the red rectangle is visible behind the blue rectangle.

<figure><img src="/files/YLlq82HWGZASm1CLLzMr" alt=""><figcaption><p>Container Alpha on the left, individual Alpha on the right</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flatredball.com/gum/gum-tool/gum-elements/general-properties/alpha.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
