■ hex 함수를 사용해 ARGB 색상의 16진수 문자열 값을 구하는 방법을 보여준다.
▶ 예제 코드 (PY)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
alphaValue = 0.8 redValue = 166 greenValue = 128 blueValue = 255 alphaHexadecimalValue = hex(int(round(alphaValue * 255, 0))).replace("0x", "") redHexadecimalValue = hex(redValue ).replace("0x", "") greenHexadecimalValue = hex(greenValue).replace("0x", "") blueHexadecimalValue = hex(blueValue ).replace("0x", "") print(f"#{alphaHexadecimalValue}{redHexadecimalValue}{greenHexadecimalValue}{blueHexadecimalValue}") # #cca680ff |