@skchr/color
    Preparing search index...

    Function colors

    • Returns TailwindCSS color value(s) from the default palette.

      The function behaves as follows:

      • If called with both shade and value parameters, it returns that color as a hex string. For example 'blue' and '500' would return the equivalent of blue-500.
      • If called with no parameters or just the 'all' parameter as the shade, it returns an array of colors from '050' to '900' for every shade.
      • If the shade is 'all' and the value is specified, it returns an array of colors at the specified value for each shade.

      To specify '050' as a number you just pass 50. Values are all valid as string or number for example '100' and100 .

      Parameters

      • Optionalshade: Tailwind | "all"

        The hue family to return.

      • Optionalvalue: ScaleValues

        The tone value of the shade. Values are in incrementals of 100. For example numeric (100) and its string equivalent ('100') are valid.

      Returns string[]

      • The Tailwind CSS color value(s).
      import { colors } from "@skchr/color";

      // We pass in red as the target hue.
      // It returns a function that can be called with an optional value parameter
      console.log(colors('red'));
      // [
      '#fef2f2', '#fee2e2',
      '#fecaca', '#fca5a5',
      '#f87171', '#ef4444',
      '#dc2626', '#b91c1c',
      '#991b1b', '#7f1d1d'
      ]


      console.log(colors('red','900'));
      // '#7f1d1d'