@nevware21/chromacon
    Preparing search index...

    Function setColorLevel

    • Manually set the current color level, overriding the automatic detection. if the level is not provided, the automatic detection will be used, resetting any manual or previously detected level.

      Parameters

      Returns void

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

      // Set the color level to 256 colors
      setColorLevel(ColorLevel.Rgb256);

      // Check if the terminal supports 256 colors
      if (isRgb256ColorSupported()) {
      console.log("256 colors are supported");
      }

      // Reset to automatic detection
      setColorLevel();

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