Skip to content

ColorRectTexture

Since 2.2.1

ColorRectTexture draws a solid ARGB-filled rectangle. It is the simplest texture type — no rounding, no border, just a flat colour.

Registry name: color_rect_texture

INFO

Extends TransformTexture — supports rotate(), scale(), transform().


Usage

java
// Opaque dark background
IGuiTexture bg = new ColorRectTexture(0xFF1A1A1A);

// Semi-transparent overlay
IGuiTexture overlay = new ColorRectTexture(0x80FFFFFF);

// From java.awt.Color
IGuiTexture red = new ColorRectTexture(java.awt.Color.RED);

LSS

css
/* Hex color literal — automatically creates a ColorRectTexture */
background: #1A1A1AFF;   /* #AARRGGBB */
background: #1A1A1A;     /* #RRGGBB (fully opaque) */
background: #FFF;        /* shorthand */
background: rgba(26, 26, 26, 255);
background: rgb(26, 26, 26);

/* Explicit color() function */
background: color(#80FFFFFF);

Fields

NameTypeDescription
colorintThe packed ARGB colour value.

Methods

MethodReturnsDescription
setColor(int)ColorRectTextureSets the packed ARGB colour.
copy()ColorRectTextureReturns a deep copy.
interpolate(IGuiTexture, float)IGuiTextureBlends towards another ColorRectTexture using OkLab colour space.

Released under the MIT License.