Class Length

Represents a length value. Length values are returned from properties of type length, and are used to define the size of a Font.

Hierarchy

  • Length

Index

Constructors

Properties

Methods

Constructors

constructor

  • Creates an instance of a length based on a value and unit.

    Parameters

    • _value: number

      The value of the length.

    • _unit: LengthUnit

      The unit of the length.

    Returns Length

Properties

unit

The unit of the length value.

value

value: number

The numeric value of the length.

Methods

toString

  • toString(): string
  • Returns string

    A (CSS compliant) representation of the length.

Static fromObject

  • fromObject(_obj: object): Length
  • Creates a Length instance given an object with a value and unit attribute.

    Parameters

    • _obj: object

      An object from which to create a Length instance.

    Returns Length

    A Length instance.