# Color

A set of standard colours that can be used in annotations in a GraphWidget.

- Source: [`aws-cloudwatch/lib/graph.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cloudwatch/lib/graph.ts#L1169)
- Type last changed: v2.18.0 · 29 Mar 2022

## Example

TypeScript:

```ts
declare const dashboard: cloudwatch.Dashboard;

dashboard.addWidgets(new cloudwatch.GraphWidget({
  // ...

  leftAnnotations: [
    { value: 1800, label: Duration.minutes(30).toHumanString(), color: cloudwatch.Color.RED, },
    { value: 3600, label: '1 hour', color: '#2ca02c', }
  ],
  verticalAnnotations: [
    { date: '2022-10-19T00:00:00Z', label: 'Deployment', color: cloudwatch.Color.RED, }
  ]
}));
```

Python:

```python
# dashboard: cloudwatch.Dashboard

dashboard.add_widgets(cloudwatch.GraphWidget(
    # ...

    left_annotations=[cloudwatch.HorizontalAnnotation(value=1800, label=Duration.minutes(30).to_human_string(), color=cloudwatch.Color.RED), cloudwatch.HorizontalAnnotation(value=3600, label="1 hour", color="#2ca02c")
    ],
    vertical_annotations=[cloudwatch.VerticalAnnotation(date="2022-10-19T00:00:00Z", label="Deployment", color=cloudwatch.Color.RED)
    ]
))
```

Java:

```java
Dashboard dashboard;

dashboard.addWidgets(GraphWidget.Builder.create()
        // ...

        .leftAnnotations(List.of(HorizontalAnnotation.builder().value(1800).label(Duration.minutes(30).toHumanString()).color(Color.RED).build(), HorizontalAnnotation.builder().value(3600).label("1 hour").color("#2ca02c").build()))
        .verticalAnnotations(List.of(VerticalAnnotation.builder().date("2022-10-19T00:00:00Z").label("Deployment").color(Color.RED).build()))
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Dashboard dashboard;

dashboard.AddWidgets(new GraphWidget(new GraphWidgetProps {
    // ...

    LeftAnnotations = new [] { new HorizontalAnnotation { Value = 1800, Label = Duration.Minutes(30).ToHumanString(), Color = Color.RED }, new HorizontalAnnotation { Value = 3600, Label = "1 hour", Color = "#2ca02c" } },
    VerticalAnnotations = new [] { new VerticalAnnotation { Date = "2022-10-19T00:00:00Z", Label = "Deployment", Color = Color.RED } }
}));
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var dashboard Dashboard

dashboard.AddWidgets(cloudwatch.NewGraphWidget(&GraphWidgetProps{
	// ...

	LeftAnnotations: []HorizontalAnnotation{
		&HorizontalAnnotation{
			Value: jsii.Number(1800),
			Label: awscdk.Duration_Minutes(jsii.Number(30)).ToHumanString(),
			Color: cloudwatch.Color_RED(),
		},
		&HorizontalAnnotation{
			Value: jsii.Number(3600),
			Label: jsii.String("1 hour"),
			Color: jsii.String("#2ca02c"),
		},
	},
	VerticalAnnotations: []VerticalAnnotation{
		&VerticalAnnotation{
			Date: jsii.String("2022-10-19T00:00:00Z"),
			Label: jsii.String("Deployment"),
			Color: cloudwatch.Color_RED(),
		},
	},
}))
```

## Properties

- `BLUE`: string (static) — blue - hex #1f77b4.

- `BROWN`: string (static) — brown - hex #8c564b.

- `GREEN`: string (static) — green - hex #2ca02c.

- `GREY`: string (static) — grey - hex #7f7f7f.

- `ORANGE`: string (static) — orange - hex #ff7f0e.

- `PINK`: string (static) — pink - hex #e377c2.

- `PURPLE`: string (static) — purple - hex #9467bd.

- `RED`: string (static) — red - hex #d62728.
