mirror of
https://github.com/InsanusMokrassar/docs.git
synced 2024-06-03 00:05:12 +00:00
1.2 KiB
1.2 KiB
Colors
Group
:dev.inmo
ArtifactId
:micro_utils.colors.common
Adding dependency:
implementation "dev.inmo:micro_utils.colors.common:latest"
INFO:
All the samples below will represent
HEXAColor
withr==0xaa
,g==0xff
,b==0x00
anda==0xff
This package contains mainly one file: HEXAColor. This file
contains unified color with HEXA format. It consumes UInt
by default constructor and r/g/b/a parameters in other main constructors:
HEXAColor(0xaaff00ffu) // 0xRGBAu as UInt
HEXAColor(r = 0xaa, g = 0xff, b = 0x00, a = 0xff)
HEXAColor(r = 0xaa, g = 0xff, b = 0x00, aOfOne = 1f)
Besides, you may use one of converters:
HEXAColor.fromAhex(0xffaaff00u) // 0xARGBu as UInt
HEXAColor.parse("rgba(aa, ff, 00, ff)")
HEXAColor.parse("rgba(aa, ff, 00)")
HEXAColor.parse("#af0")
HEXAColor.parse("#af0f")
HEXAColor.parse("#aaff00")
HEXAColor.parse("#aaff00ff")