Skip to content

Commit

Permalink
Change all colors in sample data to Oklch (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrezero authored Jan 21, 2025
1 parent 5cf4f2b commit b016834
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 37 deletions.
25 changes: 15 additions & 10 deletions docs/designer-decisions/data/decisions/color.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,31 @@
"name": "Brand Pink",
"description": "Brand Pink color",
"params": {
"value": "#d35084"
"value": "oklch(61.92% 0.1717 358.75)"
}
},
{
"model": "color-value/explicit",
"name": "Brand Blue",
"description": "Brand Blue color",
"params": {
"value": "#06b4e0"
"value": "oklch(71.53% 0.1332 223.66)"
}
},
{
"model": "color-value/explicit",
"name": "Brand Black",
"description": "Brand Black color",
"params": {
"value": "#181818"
"value": "oklch(20.9% 0 0)"
}
},
{
"model": "color-value/explicit",
"name": "Brand White",
"description": "Brand White color",
"params": {
"value": "#f7f7f7"
"value": "oklch(97.61% 0 0)"
}
},
{
Expand All @@ -134,7 +134,12 @@
"notFor": ["Typography", "Foregrounds", "Backgrounds"]
},
"params": {
"values": ["#d35084", "#06b4e0", "#181818", "#f7f7f7"]
"values": [
"oklch(61.92% 0.1717 358.75)",
"oklch(71.53% 0.1332 223.66)",
"oklch(20.9% 0 0)",
"oklch(97.61% 0 0)"
]
}
},
{
Expand All @@ -152,7 +157,7 @@
"notFor": ["Non-interactive elements"]
},
"params": {
"value": "#9B2C5A"
"value": "oklch(47.63% 0.1513 359.37)"
}
},
{
Expand All @@ -164,7 +169,7 @@
"notFor": ["Non-interactive elements"]
},
"params": {
"value": "#FDFBFC"
"value": "oklch(98.99% 0.0025 345.21)"
}
},
{
Expand All @@ -176,7 +181,7 @@
"notFor": ["Typography"]
},
"params": {
"anchor": "#d35084",
"anchor": "oklch(61.92% 0.1717 358.75)",
"after": {
"steps": 4,
"modifier": {
Expand Down Expand Up @@ -204,8 +209,8 @@
"notFor": ["Typography", "Icons", "Backgrounds", "Foregrounds"]
},
"params": {
"from": "#DD3F3F",
"to": "#3049e0",
"from": "oklch(60.12% 0.1951 25.26)",
"to": "oklch(49.35% 0.2284 268.48)",
"steps": 5
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,20 @@ Render the decision value as the foreground content color.
```mdx
<ShowDecision
store={store}
d="Action Contrast Color"
d="Brand Pink"
size="m"
viz="fg"
options={{ contrast: '#9B2C5A' }}
options={{ contrast: 'oklch(24.78% 0.0873 257.3)' }}
/>
```

<CardGrid>
<ShowDecision
store={store}
d="Action Contrast Color"
d="Brand Pink"
size="m"
viz="fg"
options={{ contrast: '#9B2C5A' }}
options={{ contrast: 'oklch(24.78% 0.0873 257.3)' }}
/>
</CardGrid>

Expand All @@ -77,7 +77,7 @@ Render the decision value as the background with custom element(s) on top.
d="Action Color"
size="m"
viz="bg"
options={{ mode: 'text', contrast: '#FDFBFC' }}
options={{ mode: 'text', contrast: 'oklch(98.99% 0.0025 345.21)' }}
/>
```

Expand All @@ -87,7 +87,7 @@ Render the decision value as the background with custom element(s) on top.
d="Action Color"
size="m"
viz="bg"
options={{ mode: 'text', contrast: '#FDFBFC' }}
options={{ mode: 'text', contrast: 'oklch(98.99% 0.0025 345.21)' }}
/>
</CardGrid>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,30 @@ Available only when [viz](/api/designer-shows/Types/ColorVizName) is set to eith

### `typeface` (default)

Renders a few characters showcasing features of a typeface.
Renders a few characters.

You can override the content via
[options.content](/api/designer-shows/Types/ColorVizOptions#-content).

```mdx
<ShowDecision store={store} d="Brand Pink" size="m" viz="fg" />
<ShowDecision store={store} d="Brand Pink" size="m" viz="fg" options={{ mode: 'typeface' }} />
```

<FlexStack vpad>
<ShowDecision store={store} d="Brand Pink" size="m" viz="fg" />
<ShowDecision store={store} d="Brand Pink" size="m" viz="fg" options={{ mode: 'typeface' }} />
</FlexStack>

### `text`

Renders a long text.

You can override the content via
[options.content](/api/designer-shows/Types/ColorVizOptions#-content).

```mdx
<ShowDecision
store={store}
d="Action Contrast Color"
size="m"
viz="fg"
options={{ mode: 'text', contrast: '#9B2C5A' }}
/>
<ShowDecision store={store} d="Brand Pink" size="xl" viz="fg" options={{ mode: 'text' }} />
```

<CardGrid>
<ShowDecision
store={store}
d="Action Contrast Color"
size="m"
viz="fg"
options={{ mode: 'text', contrast: '#9B2C5A' }}
/>
<ShowDecision store={store} d="Brand Pink" size="xl" viz="fg" options={{ mode: 'text' }} />
</CardGrid>
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ custom `content` for the first one, and switch to `text` mode on the second.

```mdx
<ShowDecision ... viz="fg" options={{ contrast: '#000000', content: 'Hello' }} />
<ShowDecision ... viz="bg" options={{ contrast: '#FDFBFC', mode: 'text' }} />
<ShowDecision ... viz="bg" options={{ contrast: '#FFFFFF', mode: 'text' }} />
```

<CardGrid>
Expand All @@ -245,7 +245,7 @@ custom `content` for the first one, and switch to `text` mode on the second.
d="Action Color"
value={false}
viz="bg"
options={{ contrast: '#FDFBFC', mode: 'text' }}
options={{ contrast: '#FFFFFF', mode: 'text' }}
/>
</CardGrid>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"model": "color-set/explicit",
"name": "Color Set Explicit Sample",
"params": {
"values": ["#d35084", "#06b4e0", "#181818", "#f7f7f7"]
"values": [
"oklch(61.92% 0.1717 358.75)",
"oklch(71.53% 0.1332 223.66)",
"oklch(20.9% 0 0)",
"oklch(97.61% 0 0)"
]
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"model": "color-value/explicit",
"name": "Color Value Explicit Sample",
"params": {
"value": "#9B2C5A"
"value": "oklch(47.63% 0.1513 359.37)"
}
}
]

0 comments on commit b016834

Please sign in to comment.