Skip to content

Instantly share code, notes, and snippets.

View siata13's full-sized avatar
💭
Keep running

Piotr Siatka siata13

💭
Keep running
View GitHub Profile
function Get-Colors {
param (
[string]$colorsDataString
)
$colorsJSONData = $colorsDataString | ConvertFrom-Json;
[Colors]$colors = [Colors]::new();
$colors.psobject.properties | ForEach-Object {
if ($colorsJSONData.($_.Name)) {
$colors.($_.Name) = $colorsJSONData.($_.Name)
class ColorCode {
[int[]]$rgba;
[string]$hex;
}
class Color {
[string]$color;
[string]$category;
[string]$type;
[ColorCode]$code;
{
"colors": [
{
"color": "black",
"category": "hue",
"type": "primary",
"code": {
"rgba": [255,255,255,1],
"hex": "#000"
}