---
id: fast-colors.colorxyz.fromobject
title: ColorXYZ.fromObject() method
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-colors](./fast-colors.md) &gt; [ColorXYZ](./fast-colors.colorxyz.md) &gt; [fromObject](./fast-colors.colorxyz.fromobject.md)

## ColorXYZ.fromObject() method

Construct a [ColorXYZ](./fast-colors.colorxyz.md) from a config object.

<b>Signature:</b>

```typescript
static fromObject(data: {
        x: number;
        y: number;
        z: number;
    }): ColorXYZ | null;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  data | { x: number; y: number; z: number; } |  |

<b>Returns:</b>

[ColorXYZ](./fast-colors.colorxyz.md) \| null
