promotional bannermobile promotional banner

ColorAPI

Lightweight chromatic algebra, color spaces, and animation library for Minecraft Fabric. Features RGB/HSV conversions, easing curves, color transitions, and texture extraction.

🎨 ColorAPI

Fabric Minecraft Java License

ColorAPI is an ultra-lightweight, high-performance mathematical and chromatic animation library designed for modern Minecraft Fabric (1.21.11+). It decouples pure color algebra and timing curves from complex rendering engines, providing a clean, reusable foundation for colored lighting, GUI widgets, particle systems, and cosmetic tinting.


⚡ Core Features

  • 🌈 Comprehensive Color Spaces: * Immutable ColorRGB record supporting sRGB, Linear spaces, gamma correction, alpha channels, and packed ARGB/RGB conversions. * ColorHSV record with robust bidirectional RGB \(\leftrightarrow\) HSV mapping.
  • 🧮 Pure Chromatic Algebra (ColorMath): * Weighted multi-source color blending (blendColors). * Clamped linear interpolation (lerp). * Photometric attenuation modulation (modulate). * Additive light accumulation (additiveAccumulate).
  • 📈 Rich Easing & Animation Engine (EasingMath): * Easing curves: Linear, Ease In/Out, Ease In-Out, Quadratic, Cubic, Sine, Exponential, Bounce, Elastic, and Step. * Temporal transition controller (ColorTransition) for smooth tick-to-tick or frame-to-frame color fading.
  • 📦 Decoupled Data Structures: * Standardized Keyframe, Sequence, and Profile records for sequencing complex multi-stage color animations.
  • 🖼️ Texture & Asset Color Extraction: * Native utilities for calculating dominant/average colors from block sprites and textures.

💻 Developer Quick Start

Add ColorAPI to your build.gradle:

repositories {
    mavenCentral()
    // or mavenLocal() if building from source
}

dependencies {
    modImplementation "mb.bartra:colorapi:1.0"
}

Basic Color Interpolation & Blending:

import mb.bartra.colorapi.ColorAPI;
import mb.bartra.colorapi.core.ColorRGB;
import mb.bartra.colorapi.core.ColorMath;

// 1. Simple Lerp between two hex colors
int startColor = 0xFF0000; // Red
int endColor   = 0x0000FF; // Blue
int blended    = ColorAPI.lerp(startColor, endColor, 0.5f); // Purple

// 2. Linear Color Modulation
ColorRGB light = ColorRGB.fromRgb(0xFFAA00);
ColorRGB shaded = light.toLinear().multiply(0.75f).toSrgb();

📄 License

ColorAPI is distributed under the open-source MIT License. Free for personal use, modpacks, and third-party mod integrations.

ColorAPI Team

profile avatar
  • 9
    Projects
  • 2.8K
    Downloads

A good explorer guy who makes tools by doing all more easily.

More from MisterBartraView all

  • CustomLight project image

    CustomLight

    Highly customizable colored light fixtures with smooth keyframe animations, redstone/copper power conduction, and custom block facades. Built for Fabric 1.21.11+.

    • 6
    • November 2, 2026
  • LightAPI project image

    LightAPI

    High-performance dynamic lighting engine and spatial indexing API for Minecraft Fabric 1.21.11+. Features volumetric shapes, double-buffered bake pipeline, and multi-light grouping.

    • 3
    • November 2, 2026
  • TriggerCommand project image

    TriggerCommand

    A powerful event-driven command & logic orchestrator for Forge. Attach reactive command logic to entities, blocks, 3D areas, and items with an optional visual node graph UI.

    • 16
    • October 24, 2026
  • Server Multimedia Manager (WaterMedia) project image

    Server Multimedia Manager (WaterMedia)

    Server-side broadcast manager to synchronize multimedia playback, screens, and audio queues across players.

    • 1.3K
    • October 24, 2026
  • CustomLight project image

    CustomLight

    Highly customizable colored light fixtures with smooth keyframe animations, redstone/copper power conduction, and custom block facades. Built for Fabric 1.21.11+.

    • 6
    • November 2, 2026
  • LightAPI project image

    LightAPI

    High-performance dynamic lighting engine and spatial indexing API for Minecraft Fabric 1.21.11+. Features volumetric shapes, double-buffered bake pipeline, and multi-light grouping.

    • 3
    • November 2, 2026
  • TriggerCommand project image

    TriggerCommand

    A powerful event-driven command & logic orchestrator for Forge. Attach reactive command logic to entities, blocks, 3D areas, and items with an optional visual node graph UI.

    • 16
    • October 24, 2026
  • Server Multimedia Manager (WaterMedia) project image

    Server Multimedia Manager (WaterMedia)

    Server-side broadcast manager to synchronize multimedia playback, screens, and audio queues across players.

    • 1.3K
    • October 24, 2026