WIllJBD
WIllJBD

Reputation: 6164

changing a Hex string at runtime

Lets say I have 0xFF222222 and would like it to reach 0xFF888888 over 5 minutes. Using Java (android) what would be the simplest way to make it change?

RGB must stay equal throughout, meaning 0xFF222222 -> 0xFF232323 -> 0xFF242424 ...

Upvotes: 0

Views: 234

Answers (1)

Chris Stratton
Chris Stratton

Reputation: 40357

Use a timer task to add 0x10101 on each execution until you reach 0xFF888888

Chances are you don't actually want a string, but a numeric value such as an int - though if you do want a string, it's easy to do the work with an int and use Integer.toHexString() to convert the result when needed.

Upvotes: 1

Related Questions