Skip to main content

Color

Color

This file contains all the color functionality, you can create color library, add color library from file etc...

BwApiColorLibraryCreate

Create a new color library object.

Python

BwApi.ColorLibraryCreate(garmentId, colorLibJson)

C++

BwApiColorLibraryCreate(garmentId, colorLibJson, libraryId);

C#

BwApi.ColorLibraryCreate(garmentId, colorLibJson);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

colorLibJson

JSON object as string that represent color library object (see Schema/color-lib.json schema).

Out

libraryId

Return the newly created library ID.

Returns: Error/success code (see errorCodes enum).

---

BwApiColorLibraryAdd

Add a new color library (.aco, .ase or .json files).

Python

BwApi.ColorLibraryAdd(garmentId, path)

C++

BwApiColorLibraryAdd(garmentId, path, libraryId);

C#

BwApi.ColorLibraryAdd(garmentId, path);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

path

Path to the .aco / .ase / .json file.

Out

libraryId

Return the newly created library ID.

Returns: Error/success code (see errorCodes enum).

Note: The file name will be used as a library name (so file name must be unique).

---

BwApiColorLibraryRemove

Remove an existing color library.

Python

BwApi.ColorLibraryRemove(garmentId, libraryId)

C++

BwApiColorLibraryRemove(garmentId, libraryId);

C#

BwApi.ColorLibraryRemove(garmentId, libraryId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

libraryId

The ID of the library to remove.

Returns: Error/success code (see errorCodes enum).

---

BwApiColorLibraryCurrentGet

Get the current selected color library ID.

Python

BwApi.ColorLibraryCurrentGet(garmentId)

C++

BwApiColorLibraryCurrentGet(garmentId, libraryId);

C#

BwApi.ColorLibraryCurrentGet(garmentId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

Out

libraryId

The current selected color library ID.

Returns: Error/success code (see errorCodes enum).

---

BwApiColorLibraryCurrentSet

Set the current color library ID.

Python

BwApi.ColorLibraryCurrentSet(garmentId, libraryId)

C++

BwApiColorLibraryCurrentSet(garmentId, libraryId);

C#

BwApi.ColorLibraryCurrentSet(garmentId, libraryId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

libraryId

The color library ID to set.

Returns: Error/success code (see errorCodes enum).

---

BwApiColorLibraryNameGet

Get the name of an existing color library.

Python

BwApi.ColorLibraryNameGet(garmentId, libraryId)

C++

BwApiColorLibraryNameGet(garmentId, libraryId, colorLibName);

C#

BwApi.ColorLibraryNameGet(garmentId, libraryId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

libraryId

The ID of the library to look for.

Out

colorLibName

The name of the color library.

Returns: Error/success code (see errorCodes enum).

---

BwApiColorLibraryIds

Get the current library IDs in the system.

Python

BwApi.ColorLibraryIds(garmentId)

C++

BwApiColorLibraryIds(garmentId, libraries);

C#

BwApi.ColorLibraryIds(garmentId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

Out

libraries

List of all color library IDs.

Returns: Error/success code (see errorCodes enum).

---

BwApiColorLibraryGetColors

Get all the colors from the previously loaded library.

Python

BwApi.ColorLibraryGetColors(garmentId, libraryId)

C++

BwApiColorLibraryGetColors(garmentId, libraryId, colors);

C#

BwApi.ColorLibraryGetColors(garmentId, libraryId);

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID.

In

libraryId

The ID of the color library.

Out

colors

JSON object as string that represent a list of color objects within the given library (see color.json schema).

Returns: Error/success code (see errorCodes enum).

---

Did this answer your question?