algonim
    Preparing search index...

    Class ColorUtil

    Index

    Constructors

    Methods

    • Parameters

      • packed: number

      Returns number

    • Parameters

      • packed: number

      Returns number

    • Parameters

      • packed: number

      Returns number

    • Constructs a color from individual channels.

      Parameters

      • red: number
      • green: number
      • blue: number
      • convert: (x: number) => number

        Converts a channel to the [0, 255] range.

      Returns number

    • Constructs a color from individual channels ranging from 0 to 255.

      Parameters

      • red: number
      • green: number
      • blue: number

      Returns number

    • Constructs a color from individual channels ranging from 0 to 1.

      Parameters

      • red: number
      • green: number
      • blue: number

      Returns number

    • Constructs a color from HSV values ranging from 0 to 1.

      Parameters

      • hue: number
      • saturation: number
      • value: number

      Returns number

    • Encodes a color as a hexadecimal string, like #abcdef.

      Parameters

      • color: number

      Returns string

    • Interprets an array of bytes into colors.

      Parameters

      • length: number
      • bytes: CouldBeIterable<number>
      • order: string = 'RGB_'

        Swizzling order of bytes. Letters that don't correspond to any channel cause that byte to be ignored. Valid channels are R/r for red, G/g for green, and B/b for blue.

      • endianness: "big" | "little" = 'big'

        In big-endian mode, the first byte is the most significant, while in little-endian mode, it's the least significant.

      Returns { colors: Uint32Array; filledPixels: number; fullyFilled: boolean }

    • Parameters

      • imageData: ImageData

      Returns Uint32Array