DgsGridListGetItemColor

From Multi Theft Auto: Wiki

This function get the color of a gridlist item.

Syntax

bool dgsGridListGetItemColor ( element gridList, int rowIndex, int columnIndex [, bool notSplitColor = false ] )

Required Arguments

  • gridList: The dgs grid list element.
  • rowIndex: Row index.
  • columnIndex: Column index.

Optional Arguments

  • notSplitColor : Whether to split color into r,g,b and a instead of a single number.

Returns

Returns an integer of the color value if the item color was get successfully, and if notSplitColor sets to true, returns four int values representing the amount of red, green, blue and alpha , false otherwise.

Example

Example 1

Click to collapse [-]
Client
DGS = exports.dgs
local numberList = DGS:dgsCreateGridList ( 0.80, 0.10, 0.15, 0.60, true )
local column = DGS:dgsGridListAddColumn ( numberList, "Column Title", 0.85 )
local row = DGS:dgsGridListAddRow ( numberList )
local myItem = DGS:dgsGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ) )
local color = DGS:dgsGridListGetItemColor ( numberList, row, column, true )
outputChatBox("Color: "..color)

Example 2

Click to collapse [-]
Client
DGS = exports.dgs
local numberList = DGS:dgsCreateGridList ( 0.80, 0.10, 0.15, 0.60, true )
local column = DGS:dgsGridListAddColumn ( numberList, "Column Title", 0.85 )
local row = DGS:dgsGridListAddRow ( numberList )
local myItem = DGS:dgsGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ) )
local r,g,b,a = DGS:dgsGridListGetItemColor ( numberList, row, column )
outputChatBox("R: "..r.." ; G: "..g.." ; B: "..b.." ; A: "..a)

See Also

Multi Language Supports

Animation

3D Interface

3D Text

Arrow List

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Ellipse Detect Area

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Switch Button

Tab Panel

Window

Plugin

Media Browser

Rounded Rectangle

Color Picker

Blur Box

Effect 3D

Nine Slice

Object Preview

QRCode

mask