Moodle PHP Documentation 4.1
Moodle 4.1.11 (Build: 20240610) (c8c84b4af18)
Box\Spout\Common\Entity\Style\Color Class Reference

Static Public Member Functions

static rgb ($red, $green, $blue)
 Returns an RGB color from R, G and B values.
 
static toARGB ($rgbColor)
 Returns the ARGB color of the given RGB color, assuming that alpha value is always 1.
 

Public Attributes

const BLACK = '000000'
 Standard colors - based on Office Online.
 
const BLUE = '0070C0'
 
const DARK_BLUE = '002060'
 
const DARK_RED = 'C00000'
 
const GREEN = '00B050'
 
const LIGHT_BLUE = '00B0E0'
 
const LIGHT_GREEN = '92D040'
 
const ORANGE = 'FFC000'
 
const PURPLE = '7030A0'
 
const RED = 'FF0000'
 
const WHITE = 'FFFFFF'
 
const YELLOW = 'FFFF00'
 

Static Protected Member Functions

static convertColorComponentToHex ($colorComponent)
 Converts the color component to its corresponding hexadecimal value.
 
static throwIfInvalidColorComponentValue ($colorComponent)
 Throws an exception is the color component value is outside of bounds (0 - 255)
 

Member Function Documentation

◆ convertColorComponentToHex()

static Box\Spout\Common\Entity\Style\Color::convertColorComponentToHex ( $colorComponent)
staticprotected

Converts the color component to its corresponding hexadecimal value.

Parameters
int$colorComponentColor component, 0 - 255
Return values
stringCorresponding hexadecimal value, with a leading 0 if needed. E.g "0f", "2d"

◆ rgb()

static Box\Spout\Common\Entity\Style\Color::rgb ( $red,
$green,
$blue )
static

Returns an RGB color from R, G and B values.

Parameters
int$redRed component, 0 - 255
int$greenGreen component, 0 - 255
int$blueBlue component, 0 - 255
Return values
stringRGB color

◆ throwIfInvalidColorComponentValue()

static Box\Spout\Common\Entity\Style\Color::throwIfInvalidColorComponentValue ( $colorComponent)
staticprotected

Throws an exception is the color component value is outside of bounds (0 - 255)

Parameters
int$colorComponent
Exceptions
Box\Spout\Common\Exception\InvalidColorException
Return values
void

◆ toARGB()

static Box\Spout\Common\Entity\Style\Color::toARGB ( $rgbColor)
static

Returns the ARGB color of the given RGB color, assuming that alpha value is always 1.

Parameters
string$rgbColorRGB color like "FF08B2"
Return values
stringARGB color

The documentation for this class was generated from the following file: