CIA Compliance Manager — API Documentation - v1.1.50
    Preparing search index...

    Function getSecurityLevelColorPair

    • Get security level color pair by level name.

      Retrieves the background and text colors for a given security level. Returns "None" colors as fallback for invalid or undefined levels.

      Parameters

      Returns SecurityLevelColorPair

      Color pair object with background and text colors

      // Basic usage
      const colors = getSecurityLevelColorPair('High');
      console.log(colors.bg); // "#27ae60"
      console.log(colors.text); // "#00e676"

      // With dynamic level
      const UserBadge = ({ level }: { level: SecurityLevel }) => {
      const colors = getSecurityLevelColorPair(level);
      return (
      <span style={{ backgroundColor: colors.bg, color: colors.text }}>
      {level}
      </span>
      );
      };
      // Fallback behavior for invalid level
      const colors = getSecurityLevelColorPair('InvalidLevel' as SecurityLevel);
      // Returns SECURITY_LEVEL_COLORS['None'] (red colors)