@nevware21/chromacon
    Preparing search index...

    Function setColorDetector

    • Manually set the color detector function to use for detecting the color level. If the function is not provided, the default automatic detection will be used.

      Parameters

      • detectFn: () => ColorLevel

        The function to use for detecting the color level

      Returns void

      import { setColorDetector, ColorLevel } from "@nevware21/chromacon";

      setColorDetector(() => {
      // Custom detection logic
      return ColorLevel.TrueColor;
      });

      // Check if the terminal supports true color
      if (isTrueColorSupported()) {
      console.log("True color is supported");
      }

      // Reset to automatic detection
      setColorDetector();