The component values defining a color in a specific color space.
- iOS 5.0+
- macOS 10.4+
- tvOS 5.0+
A color space defines a one-, two-, three-, or four-dimensional environment whose color components represent intensity values. A color component is also referred to as a color channel. An RGB color space, for example, is a three-dimensional color space whose stimuli are the red, green, and blue intensities that make up a given color. Regardless of the color space, in Core Image, color values range from
0.0 representing an absence of that component (0 percent) and
1.0 representing 100 percent.
Colors also have an alpha component, which represents the opacity of the color, with
0.0 meaning completely transparent and
1.0 meaning completely opaque. If a color does not have an explicit alpha component, Core Image paints the color as if the alpha component equals
1.0. You always provide unpremultiplied color components to Core Image, and Core Image then provides unpremultiplied color components to you. Core Image premultiplies each color component with the alpha value in order to optimize calculations. For more information on premultiplied alpha values, see Core Image Programming Guide.