<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIColor/stringRepresentation",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIColor(py)stringRepresentation"
  },
  "title" : "stringRepresentation"
}
-->

# stringRepresentation

Returns a formatted string with the unpremultiplied color and alpha components of the color.

```
var stringRepresentation: String { get }
```

## Discussion

The string representation always has four components: red, green, blue, and alpha.

Some example string representations of colors:

|`CIColor`                                      |`stringRepresentation`|
|-----------------------------------------------|----------------------|
|`[CIColor colorWithRed:0.2 green:0.4 blue:0.6]`|`"0.2 0.4 0.6 1.0"`   |
|``/CIColor/yellowColor``                       |`"1.0 1.0 0.0 1.0"`   |

To create a [`CIColor`](/documentation/CoreImage/CIColor) instance from a string representation, use the [`init(string:)`](/documentation/CoreImage/CIColor/init(string:)) method.

If the [`CIColor`](/documentation/CoreImage/CIColor) was initialized with a `CGColor` in a non-RGB `CGColorSpace`
then it will be converted to sRGB to get the red, green, and blue components.

This property is not KVO-safe because it returns a new `NSString` instance each time.
The value of the `NSString` will be the same each time it is called.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)