SheetXL - v0.3.20
    Preparing search index...

    Interface IColor

    Represents a color with optional adjustments applied.

    An IColor consists of:

    • baseColor: The underlying color, which can be a scheme color (e.g., Accent1), a built-in color (e.g., 'red', 'blue'), or defined using various color models (RGB, Hex, HSL).
    • adjustments (optional): An ordered list of color adjustments that modify the baseColor. These adjustments can include effects like grayscale, inversion, or modifications to specific color components (red, alpha, etc.).
    interface IColor {
        isIColor: true;
        adjust(adjustments: readonly Adjustment[]): IColor;
        getAdjustments(): readonly Adjustment[];
        getType(): IColor.Type;
        getVal(): string;
        isEqual(other: any): boolean;
        toBlackOrWhite(darkMode?: boolean, threshold?: number): IColor;
        toCSS(darkMode?: boolean, alpha?: boolean): string;
        toHex(darkMode?: boolean): HEX;
        toHSLA(darkMode?: boolean): HSLA;
        toRGBA(darkMode?: boolean): RGBA;
        toString(): string;
    }

    Implemented by

    Index

    Properties

    isIColor: true

    For runtime type checking.

    Methods

    • Returns a new color that is derived from this color with the adjustments applied.

      Parameters

      • adjustments: readonly Adjustment[]

        An array of Adjustments

      Returns IColor

    • Return the type of color value used (e.g., scheme, named, index, hsl, rgb, hex).

      Returns IColor.Type

    • The base value for the color before adjustments.

      Returns string

    • Returns true if the other color will resolve to the same rgb values as this color.

      Parameters

      • other: any

        The other color to compare.

      Returns boolean

    • Returns the color as either 'black or white' depending on the luminance.

      Parameters

      • OptionaldarkMode: boolean
      • Optionalthreshold: number

        The threshold to determine if the color is dark or light.

      Returns IColor

      '186'
      
    • Return a string usable with CSS color properties.

      Parameters

      • OptionaldarkMode: boolean

        If true dark colors will be used.

      • Optionalalpha: boolean

        If true alpha will be applied.

      Returns string

    • Return a HEX with adjustments applied.

      Parameters

      • OptionaldarkMode: boolean

      Returns HEX

    • Return as HSLA with adjustments applied.

      Parameters

      • OptionaldarkMode: boolean

      Returns HSLA

    • Return as RGBA with adjustments applied.

      Parameters

      • OptionaldarkMode: boolean

      Returns RGBA

    • Return the color as a string.

      Returns string