Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Contributor
Posts: 44
Registered: ‎09-14-2012
My Device: BB 10 Dev alpha
My Carrier: -
Accepted Solution

Getting Color's RGB components via QML only

[ Edited ]

For example, we have QML property or JS variable with type Color:

 

property variant color: Color.Red

 

How can I get R, G and B intensity values from it via QML code only? Is it possible?

Developer
Posts: 660
Registered: ‎10-08-2009
My Device: Bold 9900
My Carrier: Telus

Re: Getting Color's RGB components via QML only

Retrieve RGB value from the "color" variable?

----------------------------------------------------------
Twitter: @gyubok
Contributor
Posts: 44
Registered: ‎09-14-2012
My Device: BB 10 Dev alpha
My Carrier: -

Re: Getting Color's RGB components via QML only

Correct
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Getting Color's RGB components via QML only

Hi! That's not possible. These methods aren't exported to QML. But this can be worked around easily by creating a C++ helper function. Please see this thread for details:
http://supportforums.blackberry.com/t5/Native-Development/getting-Color-count/m-p/2272391#M18324

Andrey Fidrya, @zmeyc on twitter