DgsGridListGetItemColor

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

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

Custom Cursor Functions

Multi Language Supports

Animation

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Label

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Plugin

Blur Box

Color Picker

Canvas

Circle

Effect 3D

Gradient

Media Browser

Mask

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Rounded Rectangle

Screen Source