Skip to main content

Color

ColorLibraryCreate ColorLibraryAdd ColorLibraryRemove ...

Updated over 2 months ago

ColorLibraryCreate

Create a new color library object.

Python C++ C# VS Server

Python

BwApi.ColorLibraryCreate(garmentId, colorLibJson)

C++

BwApiColorLibraryCreate(garmentId, colorLibJson);

C#

BwApi.ColorLibraryCreate(garmentId, colorLibJson);

VS Server

{
	"id": "API processing order number",
	"function": "ColorLibraryCreate",
	"params": {
		"garmentId": "value",
		"colorLibJson": "value"
	}
}    

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

Error/success code (see errorCodes enum).

ColorLibraryAdd

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

Python C++ C# VS Server

Python

BwApi.ColorLibraryAdd(garmentId, path)

C++

BwApiColorLibraryAdd(garmentId, path);

C#

BwApi.ColorLibraryAdd(garmentId, path);

VS Server

{
	"id": "API processing order number",
	"function": "ColorLibraryAdd",
	"params": {
		"garmentId": "value",
		"path": {
			"download_data": {
				"url": "URL",
				"sha256": "SHA256",
				"name": "NAME"
			}
		}
	}
}    

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

Error/success code (see errorCodes enum).

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

ColorLibraryRemove

Remove an existing color library.

Python C++ C# VS Server

Python

BwApi.ColorLibraryRemove(garmentId, libraryId)

C++

BwApiColorLibraryRemove(garmentId, libraryId);

C#

BwApi.ColorLibraryRemove(garmentId, libraryId);

VS Server

{
	"id": "API processing order number",
	"function": "ColorLibraryRemove",
	"params": {
		"garmentId": "value",
		"libraryId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

In

libraryId

The ID of the library to remove

Error/success code (see errorCodes enum).

ColorLibraryCurrentGet

Get the current selected color library ID.

Python C++ C# VS Server

Python

BwApi.ColorLibraryCurrentGet(garmentId)

C++

BwApiColorLibraryCurrentGet(garmentId);

C#

BwApi.ColorLibraryCurrentGet(garmentId);

VS Server

{
	"id": "API processing order number",
	"function": "ColorLibraryCurrentGet",
	"params": {
		"garmentId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

Out

libraryId

The current selected color library ID

Error/success code (see errorCodes enum).

ColorLibraryCurrentSet

Set the current color library ID.

Python C++ C#

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

Error/success code (see errorCodes enum).

ColorLibraryNameGet

Get the name of an existing color library.

Python C++ C# VS Server

Python

BwApi.ColorLibraryNameGet(garmentId, libraryId)

C++

BwApiColorLibraryNameGet(garmentId, libraryId);

C#

BwApi.ColorLibraryNameGet(garmentId, libraryId);

VS Server

{
	"id": "API processing order number",
	"function": "ColorLibraryNameGet",
	"params": {
		"garmentId": "value",
		"libraryId": "value"
	}
}    

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

Error/success code (see errorCodes enum).

ColorLibraryIds

Get the current library IDs in the system.

Python C++ C# VS Server

Python

BwApi.ColorLibraryIds(garmentId)

C++

BwApiColorLibraryIds(garmentId);

C#

BwApi.ColorLibraryIds(garmentId);

VS Server

{
	"id": "API processing order number",
	"function": "ColorLibraryIds",
	"params": {
		"garmentId": "value"
	}
}    

Parameters

Param

Variable

Description

In

garmentId

Existing garment ID

Out

libraries

List of all color library IDs

Error/success code (see errorCodes enum).

ColorLibraryGetColors

Get all the colors from the previously loaded library.

Python C++ C# VS Server

Python

BwApi.ColorLibraryGetColors(garmentId, libraryId)

C++

BwApiColorLibraryGetColors(garmentId, libraryId);

C#

BwApi.ColorLibraryGetColors(garmentId, libraryId);

VS Server

{
	"id": "API processing order number",
	"function": "ColorLibraryGetColors",
	"params": {
		"garmentId": "value",
		"libraryId": "value"
	}
}    

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 Schema/color.json schema)

Error/success code (see errorCodes enum).

Did this answer your question?