BBjAPI::makeColor

Description

In BBj 4.0 and higher, this method creates a BBjColor object from the specified parameters.

Syntax

Return Value

Method

BBjColor

makeColor(int colorNum)

BBjColor

makeColor(int red, int green, int blue)

BBjColor

makeColor(string colorName)

BBjColor

makeColor(int red, int green, int blue, int alpha)

Parameters

Variable

Description

colorName

Should be one of the names "BLACK", "BLUE", "RED", "MAGENTA", "GREEN", "CYAN", "YELLOW", "WHITE", "DKGRAY", "GRAY" or "LTGRAY". Using any other name returns null.

colorNum

A constant accessed from the BBjSysGui or BBjAPI object.

 

Color

BLACK

BLUE 

RED 

MAGENTA

GREEN

CYAN

YELLOW

WHITE

DKGRAY

GRAY

LTGRAY

Number

0

1

2

3

4

5

6

7

8

9

10

red

Specifies the red value. The value can be in the range 0-255.

green

Specifies the green value. The value can be in the range 0-255.

blue

Specifies the blue value. The value can be in the range 0-255.

alpha

In BBj 17 and higher, specifies the alpha value. The value can be in the range 0-255.

Return Value

All versions of the makeColor method return a BBjColor object.

Remarks

When using the colorNum parameter, make sure the color number constant is entered in all uppercase letters.

Example

rem 'Create an instance of a BBjColor object

rem 'Obtain the instance of the BBjAPI object
let myAPI! = BBjAPI()
myColorBlue! = myAPI!.makeColor(215,255,100)

See Also

BBjAPI

BBjWindow

BBjColor

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.