# `GSLayer layerColor:`

*Instance Method*

The effective color used to represent the layer, or `nil` when no color is configured.

## Declaration

```swift
func layerColor(_ dark: Bool) -> NSColor?
```

```objc
- (NSColor *) layerColor:(BOOL) dark;
```

```python
layerColor_(dark: bool) -> NSColor
```

## Parameters

- `dark` — Whether to prefer a color for a dark appearance.

## Discussion

Palette color layers use their color entry from the first palette. Other layers use the color configured for the associated font master, preferring its dark-appearance variant when requested.

## See Also

### Resolving Colors

- [`GSLayer paletteColor:`](/Core/GlyphsCore/GSLayer/paletteColor:) — The layer’s palette color from the given palette, or `nil` when it cannot be resolved.
- [`GSLayer paletteInfo`](/Core/GlyphsCore/GSLayer/paletteInfo) — The effective color palettes for the layer, or `nil` when none are configured.

