Skip to content

Commit 2ac8043

Browse files
authored
Update README.md
1 parent 78bca02 commit 2ac8043

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -238,26 +238,26 @@ app.Endpoints(e => e.MapImageWizard("/image"));
238238
- string ('Hello')
239239

240240
```csharp
241-
public partial class BackgroundColorFilter : ImageSharpFilter
241+
public partial class BackgroundColorFilter : ImageSharpFilter
242+
{
243+
//use dependency injection
244+
public BackgroundColorFilter(ILogger<BackgroundColorFilter> logger)
245+
{
246+
//...
247+
}
248+
249+
[Filter]
250+
public void BackgroundColor(byte r, byte g, byte b)
242251
{
243-
//use dependency injection
244-
public BackgroundColorFilter(ILogger<BackgroundColorFilter> logger)
245-
{
246-
//...
247-
}
248-
249-
[Filter]
250-
public void BackgroundColor(byte r, byte g, byte b)
251-
{
252-
Context.Image.Mutate(m => m.BackgroundColor(new Rgba32(r, g, b)));
253-
}
254-
255-
[Filter]
256-
public void BackgroundColor(float r, float g, float b)
257-
{
258-
Context.Image.Mutate(m => m.BackgroundColor(new Rgba32(r, g, b)));
259-
}
252+
Context.Image.Mutate(m => m.BackgroundColor(new Rgba32(r, g, b)));
260253
}
254+
255+
[Filter]
256+
public void BackgroundColor(float r, float g, float b)
257+
{
258+
Context.Image.Mutate(m => m.BackgroundColor(new Rgba32(r, g, b)));
259+
}
260+
}
261261
```
262262

263263
The source generator creates the following code:

0 commit comments

Comments
 (0)