Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating docs for Color POJO #35

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
[@express-document-sdk](../overview.md) / ColorUtils

# Class: ColorUtils

Utility methods for working with color values.

## Hierarchy

- `ProxyLiveObject`

↳ **`ColorUtils`**

## Table of contents

### Methods

- [fromHex](ColorUtils.md#fromHex)
- [fromRGB](ColorUtils.md#fromRGB)
- [toHex](ColorUtils.md#toHex)

## Methods

### fromHex

▸ **fromHex**(`hex`): [`Color`](../interfaces/Color.md)

Create a new color from its equivalent RGBA hex representation. Currently only
supports formats "#RRGGBBAA" or "RRGGBBAA". If the hex value is invalid, this
method will return transparent black.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `hex` | `string` | The color in hex representation. |

#### Returns

[`Color`](../interfaces/Color.md)

A new color matching the given hex representation, or transparent black if
the hex string cannot be parsed.

___

### fromRGB

▸ **fromRGB**(`red`, `green`, `blue`, `alpha?`): [`Color`](../interfaces/Color.md)

Create a new Color. All color components should be in a 0 - 1 range.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `red` | `number` | - |
| `green` | `number` | The green component in a range from 0 - 1. |
| `blue` | `number` | The blue component in a range from 0 - 1. |
| `alpha?` | `number` | (optional) The alpha component in a range from 0 - 1. Defaults to 1 (fully opaque). |

#### Returns

[`Color`](../interfaces/Color.md)

▸ **fromRGB**(`color`): [`Color`](../interfaces/Color.md)

#### Parameters

| Name | Type |
| :------ | :------ |
| `color` | `Object` |
| `color.alpha?` | `number` |
| `color.blue` | `number` |
| `color.green` | `number` |
| `color.red` | `number` |

#### Returns

[`Color`](../interfaces/Color.md)

___

### toHex

▸ **toHex**(`color`): `string`

Get the color in 8-digit hex "#RRGGBBAA" format.

#### Parameters

| Name | Type |
| :------ | :------ |
| `color` | [`Color`](../interfaces/Color.md) |

#### Returns

`string`
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ the root of the document.

| Name | Type | Description |
| :------ | :------ | :------ |
| `color` | [`Color`](Color.md) | The color to use for the fill. |
| `color` | [`Color`](../interfaces/Color.md) | The color to use for the fill. |

#### Returns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,21 @@ ___

### color

• `get` **color**(): `undefined` \| [`Color`](Color.md)
• `get` **color**(): `undefined` \| [`Color`](../interfaces/Color.md)

The color of the single color shape.

#### Returns

`undefined` \| [`Color`](Color.md)
`undefined` \| [`Color`](../interfaces/Color.md)

• `set` **color**(`color`): `void`

#### Parameters

| Name | Type |
| :------ | :------ |
| `color` | `undefined` \| [`Color`](Color.md) |
| `color` | `undefined` \| [`Color`](../interfaces/Color.md) |

#### Returns

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[@express-document-sdk](../overview.md) / Color

# Interface: Color

Represents an RGBA color.

## Table of contents

### Properties

- [alpha](Color.md#alpha)
- [blue](Color.md#blue)
- [green](Color.md#green)
- [red](Color.md#red)

## Properties

### alpha

• **alpha**: `number`

The alpha channel in range from 0 - 1.

___

### blue

• **blue**: `number`

The blue channel in range from 0 - 1.

___

### green

• **green**: `number`

The green channel in range from 0 - 1.

___

### red

• **red**: `number`

The red channel in range from 0 - 1.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Represents a solid-color fill.

### color

• `Readonly` **color**: [`Color`](../classes/Color.md)
• `Readonly` **color**: [`Color`](Color.md)

The fill color.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Represents a stroke in the scenegraph. See [StrokableNode](../classes/StrokableN

### color

• `Readonly` **color**: [`Color`](../classes/Color.md)
• `Readonly` **color**: [`Color`](Color.md)

The color of a stroke.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Properties that can be provided to create a stroke.

### color

• `Readonly` **color**: [`Color`](../classes/Color.md)
• `Readonly` **color**: [`Color`](Color.md)

The color of a stroke.

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

- [ArrowHeadType](enums/ArrowHeadType.md)
- [BlendMode](enums/BlendMode.md)
- [ColorSpace](enums/ColorSpace.md)
- [FillRule](enums/FillRule.md)
- [FillType](enums/FillType.md)
- [SceneNodeType](enums/SceneNodeType.md)
Expand All @@ -23,9 +22,8 @@

- [ArtboardList](classes/ArtboardList.md)
- [ArtboardNode](classes/ArtboardNode.md)
- [Color](classes/Color.md)
- [ColorUtils](classes/ColorUtils.md)
- [ComplexShapeNode](classes/ComplexShapeNode.md)
- [ContainerNode](classes/ContainerNode.md)
- [Context](classes/Context.md)
- [Editor](classes/Editor.md)
- [EllipseNode](classes/EllipseNode.md)
Expand Down Expand Up @@ -53,6 +51,7 @@
### Interfaces

- [BitmapImage](interfaces/BitmapImage.md)
- [Color](interfaces/Color.md)
- [ColorFill](interfaces/ColorFill.md)
- [Fill](interfaces/Fill.md)
- [IFillableNode](interfaces/IFillableNode.md)
Expand All @@ -63,4 +62,3 @@
- [RectangleGeometry](interfaces/RectangleGeometry.md)
- [Stroke](interfaces/Stroke.md)
- [StrokeOptions](interfaces/StrokeOptions.md)
- [Utils](interfaces/Utils.md)