Skip to content

[mxcad_3d API Document](../README. md)/Mx3dGeColor

Class: Mx3dGeColor

The class that represents color objects.

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new Mx3dGeColor()

Create a color object.

Overrides

Mx3dBaseObject.constructor

new Mx3dGeColor(theColorName)

Create a color object using a color name.

Parameters

NameTypeDescription
TheColorName[MxNameOfColor] (../enums/MdGe. MxNameOfColor. md)Color name

Overrides

Mx3dBaseObject.constructor

new Mx3dGeColor(theR, theG, theB, theType)

Create a color object using RGB values and color types.

Parameters

NameTypeDescription
TheRnumberred component
TheGNumberGreen component
TheBNumberBlue component
TheType[MxTypeOfColor] (../enums/MdGe. MxTypeOfColor. md)Color type

Overrides

Mx3dBaseObject.constructor

Methods

Blue

Blue(): number

Obtain the value of the blue component.

Returns

number

Blue component.


ChangeContrast

ChangeContrast(theDelta): void

Change the contrast of colors.

Parameters

NameTypeDescription
The Deltanumbercontrast variation

Returns

void


ChangeIntensity

ChangeIntensity(theDelta): void

Change the intensity of the color.

Parameters

NameTypeDescription
The Deltanumberintensity change

Returns

void


DeltaE2000

DeltaE2000(theOther): number

Calculate the Delta E2000 difference between colors.

Parameters

NameTypeDescription
TheOther[Mx3dGeColor] (Mx3dGeColor. md)Another color object

Returns

number

Delta E2000 differential value.


Distance

Distance(theColor): number

Calculate the distance between colors.

Parameters

NameTypeDescription
TheColor[Mx3dGeColor] (Mx3dGeColor. md)Another color object

Returns

number

Color distance.


Green

Green(): number

Obtain the value of the green component.

Returns

number

Green component.


Hue

Hue(): number

Obtain color tone values.

Returns

number

Color tone value.


IsDifferent

IsDifferent(theOther): boolean

Determine if the colors are different.

Parameters

NameTypeDescription
TheOther[Mx3dGeColor] (Mx3dGeColor. md)Another color object

Returns

boolean

Is it different.


IsEqual

IsEqual(theOther): boolean

Determine if the colors are the same.

Parameters

NameTypeDescription
TheOther[Mx3dGeColor] (Mx3dGeColor. md)Another color object

Returns

boolean

Are they the same.


Light

Light(): number

Obtain brightness value.

Returns

number

Brightness value.


Name

Name(): MxNameOfColor

Get the name of the color.

Returns

MxNameOfColor

Color name.


Red

Red(): number

Obtain the value of the red component.

Returns

number

The red component.


Saturation

Saturation(): number

Obtain saturation value.

Returns

number

Saturation value.


SetValues

SetValues(theName): void

Set the value of the color.

Parameters

NameTypeDescription
TheName[MxNameOfColor] (../enums/MdGe. MxNameOfColor. md)Color name

Returns

void

SetValues(theC1, theC2, theC3, theType): void

Set the value of the color.

Parameters

NameTypeDescription
TheC1NumberRed component
TheC2NumberGreen component
TheC3NumberBlue component
TheType[MxTypeOfColor] (../enums/MdGe. MxTypeOfColor. md)Color type

Returns

void


SquareDistance

SquareDistance(theColor): number

Calculate the square distance between colors.

Parameters

NameTypeDescription
TheColor[Mx3dGeColor] (Mx3dGeColor. md)Another color object

Returns

number

Color squared distance.