KB-13594: Retrieving the RGB value from an absolute value.

Question:

How can I convert an absolute decimal value into its separate RGB values?

Solution:

To do so, you will need to use scripts. In the example below, the script has been added to a button’s Click event: 

Dim ColorValue, R, G, B

ColorValue = Screen.Item(“Rectangle1”).ForegroundColor

B = Int(ColorValue / 65536)
G = Int((ColorValue – 65536 * B) / 256)
R = ColorValue – (65536 * B + 256 * G)

MsgBox “R = ” & R & Chr(13) & “G = ” & G & Chr(13) & “B = ” & B

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *