Color Codes

32 views
Skip to first unread message

Hossein Amerkashi

unread,
Jun 8, 2018, 5:39:03 PM6/8/18
to app-inventor-o...@googlegroups.com
Hello, 

Given an RGB codes (or a valid color int code), how would I change it to their equivalent values as mentioned in Component.java class? I would like to add a new value based on a new RGB codes. 

Thanks


Evan W. Patton

unread,
Jun 8, 2018, 9:05:03 PM6/8/18
to app-inventor-o...@googlegroups.com
Hi Hossein,

The color constants in Component.java are signed 32-bit integers in the hexadecimal form 0xAARRGGBB where each pair corresponds to the alpha, red, green, and blue channels, respectively. We represent them that way for convenience, but you could just as easily provide the decimal representation, e.g. -1 for white.

Does that help?

Cheers,
Evan

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-so...@googlegroups.com.
To post to this group, send email to app-inventor-o...@googlegroups.com.
Visit this group at https://groups.google.com/group/app-inventor-open-source-dev.
For more options, visit https://groups.google.com/d/optout.

Hossein Amerkashi

unread,
Jun 9, 2018, 9:30:43 AM6/9/18
to app-inventor-o...@googlegroups.com
Hi Evan,

Thanks for your response; that greatly helps. 

-Hossein.

On Fri, Jun 8, 2018 at 9:04 PM, Evan W. Patton <ewpa...@gmail.com> wrote:
Hi Hossein,

The color constants in Component.java are signed 32-bit integers in the hexadecimal form 0xAARRGGBB where each pair corresponds to the alpha, red, green, and blue channels, respectively. We represent them that way for convenience, but you could just as easily provide the decimal representation, e.g. -1 for white.

Does that help?

Cheers,
Evan

Sent from my iPhone

On Jun 8, 2018, at 17:38, Hossein Amerkashi <kkas...@gmail.com> wrote:

Hello, 

Given an RGB codes (or a valid color int code), how would I change it to their equivalent values as mentioned in Component.java class? I would like to add a new value based on a new RGB codes. 

Thanks


--
You received this message because you are subscribed to the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-source-dev+unsub...@googlegroups.com.
To post to this group, send email to app-inventor-open-source-dev@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-source-dev+unsub...@googlegroups.com.
To post to this group, send email to app-inventor-open-source-dev@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages