* Read color as packed u32 (0xRRGGBBAA format) * 读取颜色为打包的 u32(0xRRGGBBAA 格式)
(bHasAlpha: boolean = false)
| 248 | * 读取颜色为打包的 u32(0xRRGGBBAA 格式) |
| 249 | */ |
| 250 | public readColor(bHasAlpha: boolean = false): number { |
| 251 | const r = this.getUint8(); |
| 252 | const g = this.getUint8(); |
| 253 | const b = this.getUint8(); |
| 254 | const a = this.getUint8(); |
| 255 | return ((r << 24) | (g << 16) | (b << 8) | (bHasAlpha ? a : 0xFF)) >>> 0; |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * Read color as CSS string (always reads 4 bytes: r, g, b, a) |