flâneur — a map of the web's best reading

Color | Apple Developer Documentation

developer.apple.com · 185 words · saved by 1 readers

Specify component values, like red, green, and blue; hue, saturation, and brightness; or white level: Create a color instance from another color, like a UIColor or an NSColor: Use one of a palette of predefined colors, like black, green, and purple. Some view modifiers can take a color as an argument. For example, foregroundStyle(_:) uses the color you provide to set the foreground color for view elements, like text or SF Symbols: Because SwiftUI treats colors as View instances, you can also directly add them to a view hierarchy. For example, you can layer a rectangle beneath a sun image using colors defined above: A color used as a view expands to fill all the space it’s given, as defined by the frame of the enclosing ZStack in the above example: SwiftUI only resolves a color to a concrete value just before using it in a given environment. This enables a context-dependent appearance for system defined colors, or those that you load from an Asset Catalog. For example, a color can have

To navigate the symbols, press Up Arrow, Down Arrow, Left Arrow or Right Arrow No items were found 1 item was found {number} items were found. Tab back to navigate through them. re looking for can't be found."},"color-scheme":{"select":"Select a color scheme preference","auto":"Auto","dark":"Dark","light":"Light"},"accessibility":{"strike":{"start":"start of stricken text","end":"end of stricken text"},"code":{"start":"start of code block","end":"end of code block"},"skip-navigation":"Skip Navigation","in-page-link":"in page link"},"select-language":"Select the language for this page","icons":

Explore this link on the map →

related reading