<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/GraphicsContext/Filter/grayscale(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15GraphicsContextV6FilterV9grayscaleyAESdFZ"
  },
  "title" : "grayscale(_:)"
}
-->

# grayscale(_:)

Returns a filter that applies a grayscale adjustment.

```
static func grayscale(_ amount: Double) -> GraphicsContext.Filter
```

## Parameters

`amount`

An amount that controls the effect. A value of one
makes the image completely gray. A value of zero leaves the
result unchanged. Other values apply a linear multiplier effect.

## Return Value

A filter that applies a grayscale adjustment.

## Discussion

This filter is equivalent to the `grayscale` filter primitive
defined by the Scalable Vector Graphics (SVG) specification.

---

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)