Gunmetal

A dark, cool blue -- the dependable foundation of trustworthy interfaces.

Hex
#2a3439
sRGB
rgb(42 52 57)
OKLCH
oklch(0.3178 0.0162 229.5)

Gunmetal is a curated PHPColor catalog color with the canonical value #2a3439.

Create Gunmetal in PHP

Parse the catalog’s canonical value once, then keep the resulting color object throughout the rest of your code.

<?php

use PhpColor\Color\Color;

$gunmetal = Color::parse('#2A3439');
use PhpColor\Color\Color; $gunmetal = Color::parse('#2A3439');

ColorInterface

$gunmetal

#2a3439 · oklch(0.3178 0.0162 229.5)

Tint Gunmetal for a system

Gunmetal is a neutral, so rotating its hue changes nothing. Design systems rarely ship a pure neutral either: give it a trace of chroma and it belongs to the palette around it.

<?php

$neutral = $gunmetal->to('oklch');

foreach (['warm' => 60, 'fresh' => 150, 'cool' => 250] as $name => $hue) {
    echo $neutral->withChannel('c', 0.02)->withChannel('h', $hue)->toHex().PHP_EOL;
}
$neutral = $gunmetal->to('oklch'); foreach (['warm' => 60, 'fresh' => 150, 'cool' => 250] as $name => $hue) { echo $neutral->withChannel('c', 0.02)->withChannel('h', $hue)->toHex().PHP_EOL; }
  1. Warm#3a3028
  2. Fresh#2b352d
  3. Cool#2b333c
Gunmetal kept at the same lightness, pulled warm, fresh and cool

Generate a Gunmetal scale

Keep the original hue and chroma, then vary OKLCH lightness to produce perceptually ordered steps.

<?php

$oklch = $gunmetal->to('oklch');

foreach ([0.97, 0.92, 0.84, 0.74, 0.66, 0.58, 0.48, 0.40, 0.32, 0.24, 0.16] as $lightness) {
    $step = $oklch->withChannel('l', $lightness);
}
$oklch = $gunmetal->to('oklch'); foreach ([0.97, 0.92, 0.84, 0.74, 0.66, 0.58, 0.48, 0.40, 0.32, 0.24, 0.16] as $lightness) { $step = $oklch->withChannel('l', $lightness); }
50
100
200
300
400
500
600
700
800
900
950
Explore named color scales →

Format Gunmetal for the web

The same object can emit a compact Hex value, an sRGB CSS function, or its perceptual OKLCH coordinates.

<?php

$hex   = $gunmetal->toHex();
$rgb   = $gunmetal->toCss('srgb');
$oklch = $gunmetal->to('oklch')->toCss();
$hex = $gunmetal->toHex(); $rgb = $gunmetal->toCss('srgb'); $oklch = $gunmetal->to('oklch')->toCss();
hex
#2a3439
rgb
rgb(42 52 57)
oklch
oklch(0.317797 0.0162408 229.543)

Keep exploring

Continue from Gunmetal