Colorways
Colorway is a combination of color, seams, trims, fabrics, and artwork of a garment. Use the Colorway API to create multiple colorways for a garment, update colorway and so on.
For more information about the feature, please visit here.
To learn more about the rest of the API, please refer to Colorway in the repository.
Getting Colorways ids
Code Snippet
BwApi.GarmentColorwayIds(garment_id)
BwApiGarmentColorwayIds(garmentId);
BwApi.GarmentColorwayIds(garmentId);
Result
Ids of the following colorways:
Deleting a Colorway
Code Snippet
# assuming colorway_id is a valid colorway id
BwApi.ColorwayDelete(garment_id, colorway_id)
// assuming colorwayId is a valid colorway id
BwApiColorwayDelete(garmentId, colorwayId);
// assuming colorwayId is a valid colorway id
BwApi.ColorwayDelete(garmentId, colorwayId);
Result
Getting the Current Colorway
Code Snippet
current_colorway = BwApi.ColorwayCurrentGet(garment_id)
int currentColorway;
BwApiColorwayCurrentGet(garmentId, ¤tColorway);
BwApi.ColorwayCurrentGet(garmentId, out currentColorway);
Result
The id of the curent colorway.
Setting the Current Colorway
Code Snippet
# assuming the colorway_id is a valid colorway id
BwApi.ColorwayCurrentSet(garment_id, colorway_id)
// assuming the colorwayId is a valid colorway id
BwApiColorwayCurrentSet(garmentId, colorwayId);
// assuming the colorwayId is a valid colorway id
BwApi.ColorwayCurrentSet(garmentId, colorwayId);
Result
Cloning a Colorway
Code Snippet
# assuming the colorway_id is a valid colorway id
new_colorway_id = BwApi.ColorwayClone(garment_id, colorway_id)
int newColorwayId;
// assuming the colorwayId is a valid colorway id
BwApiColorwayClone(garmentId, colorwayId, &newColorwayId);
int newColorwayId;
// assuming the colorwayId is a valid colorway id
BwApi.ColorwayClone(garmentId, colorwayId, out newColorwayId);
Result
Getting the Material ids of a Colorway
Code Snippet
# assuming the colorway_id is a valid colorway id
BwApi.ColorwayMaterialIds(garment_id, colorway_id)
BwApiVectorInt* materialIds = BwApiVectorIntCreate();
// assuming the colorwayId is a valid colorway id
BwApiColorwayMaterialIds(garmentId, colorwayId, materialIds);
BwApiVectorInt materialIds = new BwApiVectorInt();
// assuming the colorwayId is a valid colorway id
BwApi.ColorwayMaterialIds(garmentId, colorwayId, materialIds);
Result
A list of material ids from given colorway id
Getting the Colorway Name
Code Snippet
# assuming the colorway_id is a valid colorway id
BwApi.ColorwayNameGet(garment_id, colorway_id)
BwApiString* colorwayName = BwApiStringCreate();
// assuming the colorway_id is a valid colorway id
BwApiColorwayNameGet(garmentId, colorwayId, colorwayName);
string colorwayName;
// assuming the colorway_id is a valid colorway id
BwApi.ColorwayNameGet(garmentId, colorwayId, out colorwayName);
Result
The name of the colorway
Setting the Colorway Name
Code Snippet
# assuming the colorway_id is a valid colorway id
BwApi.ColorwayNameSet(garment_id, colorway_id, 'colorway name')
// assuming the colorway_id is a valid colorway id
BwApiColorwayNameSet(garmentId, colorwayId, "colorway name");
string colorwayName;
// assuming the colorway_id is a valid colorway id
BwApi.ColorwayNameSet(garmentId, colorwayId, "colorway name");
Result
Getting Colors in Use
Code Snippet
# assuming the colorway_id is a valid colorway id
colors_in_use = BwApi.ColorwayColorsInUseGet(garment_id, colorway_id)
BwApiVectorColor* colors = BwApiVectorColorCreate();
// assuming the colorwayId is a valid colorway id
BwApiColorwayColorsInUseGet(garmentId, colorwayId, colors);
BwApiVectorColor colors = new BwApiVectorColor();
// assuming the colorwayId is a valid colorway id
BwApi.ColorwayColorsInUseGet(garmentId, colorwayId, colors);
Result
The colors in use in a colorway. The return value from this function is an array of color. Note: color is represented by RGB data.
Updating Colors in Use
Code Snippet
# assuming the colorway_id is a valid colorway id
BwApi.ColorwayColorsInUseUpdate(garment_id, colorway_id, src_color, dest_color)
// assuming the colorwayId is a valid colorway id
BwApiColorwayColorsInUseUpdate(garmentId, colorwayId, srcColor, destColor);
// assuming the colorwayId is a valid colorway id
BwApi.ColorwayColorsInUseUpdate(garmentId, colorwayId, srcColor, destColor);