mirror of
https://github.com/penpot/penpot-plugins.git
synced 2025-01-22 14:49:27 -05:00
feat(plugin-types): add methos for colors
This commit is contained in:
parent
2b12fe96cb
commit
6b94617029
1 changed files with 12 additions and 11 deletions
23
libs/plugin-types/index.d.ts
vendored
23
libs/plugin-types/index.d.ts
vendored
|
@ -293,31 +293,32 @@ export interface PenpotColor {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO PenpotColorShapeInfoEntry
|
* Entry for the color shape additional information.
|
||||||
*/
|
*/
|
||||||
export interface PenpotColorShapeInfoEntry {
|
export interface PenpotColorShapeInfoEntry {
|
||||||
/**
|
/**
|
||||||
* TODO property
|
* Property that has the color (example: fill, stroke...)
|
||||||
*/
|
*/
|
||||||
readonly property: string;
|
readonly property: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO index
|
* For properties that are indexes (such as fill) represent the index
|
||||||
|
* of the color inside that property.
|
||||||
*/
|
*/
|
||||||
readonly index: number;
|
readonly index?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO shapeId
|
* Identifier of the shape that contains the color
|
||||||
*/
|
*/
|
||||||
readonly shapeId: string;
|
readonly shapeId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO PenpotColorShapeInfo
|
* Additional color information for the methods to extract colors from a list of shapes.
|
||||||
*/
|
*/
|
||||||
export interface PenpotColorShapeInfo {
|
export interface PenpotColorShapeInfo {
|
||||||
/**
|
/**
|
||||||
* TODO shapesInfo
|
* List of shapes with additional information
|
||||||
*/
|
*/
|
||||||
readonly shapesInfo: PenpotColorShapeInfoEntry[];
|
readonly shapesInfo: PenpotColorShapeInfoEntry[];
|
||||||
}
|
}
|
||||||
|
@ -2288,14 +2289,14 @@ export interface PenpotContext {
|
||||||
getSelectedShapes(): PenpotShape[];
|
getSelectedShapes(): PenpotShape[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: getSelectedColors
|
* TODO: shapesColors
|
||||||
*/
|
*/
|
||||||
getColors(shapes: PenpotShape[]): (PenpotColor & PenpotColorShapeInfo)[];
|
shapesColors(shapes: PenpotShape[]): (PenpotColor & PenpotColorShapeInfo)[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: changeSelectedColor
|
* TODO: replaceColor
|
||||||
*/
|
*/
|
||||||
changeColor(
|
replaceColor(
|
||||||
shapes: PenpotShape[],
|
shapes: PenpotShape[],
|
||||||
oldColor: PenpotColor,
|
oldColor: PenpotColor,
|
||||||
newColor: PenpotColor
|
newColor: PenpotColor
|
||||||
|
|
Loading…
Add table
Reference in a new issue