MAIDR JavaScript API
    Preparing search index...
    • The span of the run of one color through center in a row of RGBA pixels.

      The color is the one most common within a few pixels of the centre, so a vertical grid line drawn through the middle of a translucent bar is not mistaken for the bar. The run may cross a pixel or two of another color for the same reason.

      Parameters

      • row: ArrayLike<number>

        RGBA bytes, four per pixel

      • width: number

        Pixels in the row

      • center: number

        The pixel at the bar's centre

      • limits: RunLimits = {}

        How far the run may reach, and the outline it takes in

      Returns { start: number; end: number; filled: boolean } | null

      The first and last pixel of the run, and whether it reached its limit on both sides (the bar fills its column), or null when the centre is transparent (nothing is drawn there)