Bitbybit Docs
    Preparing search index...

    Class JSCADColors

    Giving JSCAD geometry a color of its own. A colored entity is always drawn in that color, ahead of whatever color the drawing options ask for; the color survives transforms but a boolean result starts uncolored again.

    Index

    Constructors

    colorize

    Constructors

    colorize

    • Gives a solid, a 2D shape or a path a fixed color from a hex string, returning a colored copy; a list gives a list of colored copies in the same order.

      The color wins over the color of the drawing options, so leave the entity uncolored to control it there.

      Parameters

      • inputs: ColorizeDto

        The geometry, or a list of it, and the hex color

      Returns Promise<JSCADEntity | JSCADEntity[]>

      The colored geometry, one or a list to match the input

      const red = await bitbybit.jscad.colors.colorize({ geometry: cube, color: "#ff0000" });