@amirsavand/ngx-common - v5.1.0
    Preparing search index...

    Class ColorGenerator

    Utility class for generating theme specific colors based on a primary color.

    Index

    Constructors

    Methods

    • Generates a text-specific color based on a primary color and code.

      Parameters

      • primary: string

        The primary color in hex format (e.g., "#575fcf").

      • code: string

        The unique code.

      Returns string

      A text-specific color.

    • Generates a hue value based on a string.

      Parameters

      • str: string

        The string to hash.

      Returns number

      A hue value between 0 and 360.

    • Converts a hex color to HSL.

      Parameters

      • color: string

        The hex color to convert.

      Returns HSL

      An object containing HSL values (h: 0-360, s: 0-100, l: 0-100).

    • Converts HSL to a hex color.

      Parameters

      • hsl: HSL

        The HSL values to convert.

      Returns string

      The resulting hex color.