🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

com.sweaxizone.color

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.sweaxizone.color

Color library

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

com.sweaxizone.color

Documentation

Color

The Color class is similiar to NPM color, but supports calculating color difference (color.delta(other)) and does not need a separate typings package.

Color observer

Utility for detecting the computed character color (the cascading color property) in an element. This is useful for icons that adapt to light and dark themes.

import { ColorObserver } from "com.sweaxizone.color";
import { useEffect, useRef } from "react";

const ref = useRef<HTMLDivElement | null>(null);

useEffect(() => {
    // color observer
    const color_observer = new ColorObserver(ref.current, color => {
        console.log("light =", color.isLight());
    });

    // cleanup function
    return () => {
        color_observer.cleanup();
    };
}, []);

Keywords

color

FAQs

Package last updated on 17 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts