SheetXL - v1.0.2
    Preparing search index...

    Interface IShapeStyle

    What a shape draws with: its fill and its line.

    A shape's style reads resolved: what the shape states itself, over what its theme style gives it (the references into the theme's format scheme that a file's style element names), over SheetXL's defaults for a shape that states neither. A member of a group that takes its group's fill reads the nearest enclosing group's.

    Writes state values on the shape: setFill('red') makes the fill the shape's own, and setFill(null) hands it back to the theme style. toJSON answers only what the shape states, never the resolved values; isThemed says whether it states anything at all. A partial fill update merges into the resolved fill, so a color on a themed shape gives a solid fill of that color; setFillNone() states that the shape has no fill, which is not the same as leaving it to the theme style.

    Every write is one undoable step, transactional like the rest of the shape.

    const style = movable.getContent<IShape>().getStyle();
    style.setFill('#ffd966'); // a solid fill
    style.getStroke().setWidth(2.25); // the theme's line color, wider
    style.update({ stroke: { fill: 'none' } }); // no line
    style.clear(); // back to the theme style
    interface IShapeStyle {
        isIShapeStyle: true;
        clear(options?: ITransaction.OperationOptions): IShapeStyle;
        getFill(): INone | ISolid | IGradient | IPattern | IImage;
        getStroke(): IStroke;
        isThemed(): boolean;
        setFill(
            fill: IFill.Update,
            options?: ITransaction.OperationOptions,
        ): IShapeStyle;
        setFillGradient(options?: ITransaction.OperationOptions): IGradient;
        setFillNone(options?: ITransaction.OperationOptions): INone;
        setFillPattern(options?: ITransaction.OperationOptions): IPattern;
        setFillSolid(options?: ITransaction.OperationOptions): ISolid;
        setStroke(
            stroke: IStroke.Update,
            options?: ITransaction.OperationOptions,
        ): IShapeStyle;
        setStrokeNone(options?: ITransaction.OperationOptions): IStroke;
        toJSON(): IShapeStyle.JSON | null;
        update(
            update: IShapeStyle.Update,
            options?: ITransaction.OperationOptions,
        ): IShapeStyle;
    }

    Hierarchy (View Summary)

    Index
    isIShapeStyle: true

    For type checking.

    • The line, resolved. A shape that states none draws its theme style's; a line the shape states without a color takes the theme style's color, as in Excel.

      Returns IStroke

    • Whether the shape states nothing of its own: it draws with its theme style alone.

      Returns boolean

    • What the shape states itself, never the resolved values; null when it states nothing.

      Returns IShapeStyle.JSON | null