Skip to content

BasicColor

Refaltor77 edited this page Mar 29, 2026 · 1 revision

BasicColor

Color utility class with predefined colors and generators.

Usage

use refaltor\ui\colors\BasicColor;

All colors are returned as RGB float arrays [R, G, B] with values from 0.0 to 1.0.

Predefined Colors

BasicColor::white();    // [1.0, 1.0, 1.0]
BasicColor::black();    // [0.0, 0.0, 0.0]
BasicColor::red();      // [1.0, 0.0, 0.0]
BasicColor::green();    // [0.0, 1.0, 0.0]
BasicColor::blue();     // [0.0, 0.0, 1.0]
BasicColor::yellow();   // [1.0, 1.0, 0.0]
BasicColor::cyan();     // [0.0, 1.0, 1.0]
BasicColor::magenta();  // [1.0, 0.0, 1.0]

Custom RGB

BasicColor::rgb(0.5, 0.3, 0.9); // Custom color

Random Colors

BasicColor::randomColor();        // Random RGB
BasicColor::randomPastelColor();  // Random soft color
BasicColor::randomShadeOfGray();  // Random grayscale

Complementary

$comp = BasicColor::complementaryColor(BasicColor::red());
// Returns [0.0, 1.0, 1.0] (cyan)

Default Constant

BasicColor::DEFAULT; // [1.0, 1.0, 1.0] (white)

See Also

Clone this wiki locally