@versatiles/style
    Preparing search index...

    Interface HSV

    Represents a color in the HSV (Hue, Saturation, Value) color space. Extends the base Color class.

    interface HSV {
        a: number;
        h: number;
        s: number;
        v: number;
        asArray(): [number, number, number, number];
        asHex(): string;
        asHSL(): HSL;
        asHSV(): HSV;
        asRGB(): RGB;
        asString(): string;
        blend(value: number, blendColor: Color): RGB;
        brightness(value: number): RGB;
        clone(): HSV;
        contrast(value: number): RGB;
        darken(value: number): RGB;
        fade(value: number): HSV;
        gamma(value: number): RGB;
        invert(): RGB;
        invertLuminosity(): HSL;
        lighten(value: number): RGB;
        rotateHue(offset: number): HSL;
        round(): HSV;
        saturate(ratio: number): HSL;
        setHue(value: number): HSV;
        tint(value: number, tintColor: Color): RGB;
        toHSV(): HSV;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Returns the HSV color as an array of numbers.

      Returns [number, number, number, number]

      An array containing the hue, saturation, value, and alpha components.

    • Converts the color to a hexadecimal string.

      Returns string

      The hexadecimal representation of the color.

    • Returns the color as a string representation.

      Returns string

      A string representation of the color.

    • Blends the color with another color.

      Parameters

      • value: number

        The blend ratio.

      • blendColor: Color

        The color to blend with.

      Returns RGB

      A new RGB color that is blended.

    • Adjusts the brightness of the color.

      Parameters

      • value: number

        The brightness adjustment value.

      Returns RGB

      A new RGB color with adjusted brightness.

    • Creates a new HSV color that is a copy of the current color.

      Returns HSV

      A new HSV color that is a clone of the current color.

    • Adjusts the contrast of the color.

      Parameters

      • value: number

        The contrast adjustment value.

      Returns RGB

      A new RGB color with adjusted contrast.

    • Darkens the color by a given value.

      Parameters

      • value: number

        The amount to darken the color.

      Returns RGB

      A new RGB color that is darkened.

    • Fades the color by a given value.

      Parameters

      • value: number

        The amount to fade the color by, in the range [0, 1].

      Returns HSV

      A new HSV color with the alpha component faded by the given value.

    • Applies gamma correction to the color.

      Parameters

      • value: number

        The gamma correction value.

      Returns RGB

      A new RGB color with gamma correction applied.

    • Lightens the color by a given value.

      Parameters

      • value: number

        The amount to lighten the color.

      Returns RGB

      A new RGB color that is lightened.

    • Rotates the hue of the color by a given offset.

      Parameters

      • offset: number

        The amount to rotate the hue.

      Returns HSL

      A new HSL color with the hue rotated.

    • Returns a new HSV color with the components rounded to the nearest integer.

      Returns HSV

      A new HSV color with rounded components.

    • Saturates the color by a given ratio.

      Parameters

      • ratio: number

        The ratio to saturate the color.

      Returns HSL

      A new HSL color with increased saturation.

    • Sets the hue component of the color.

      Parameters

      • value: number

        The new hue value, in the range [0, 360].

      Returns HSV

      A new HSV color with the updated hue component.

    • Tints the color by blending it with another color.

      Parameters

      • value: number

        The blend ratio.

      • tintColor: Color

        The color to blend with.

      Returns RGB

      A new RGB color that is tinted.

    Properties

    a: number

    The alpha (opacity) component of the color, in the range [0, 1].

    h: number

    The hue component of the color, in the range [0, 360].

    s: number

    The saturation component of the color, in the range [0, 100].

    v: number

    The value (brightness) component of the color, in the range [0, 100].