Bimba.git

ref: 68ae37f62658ef2b5dfe364bfa283d03b4f35951

app/src/main/java/xyz/apiote/bimba/czwek/repo/Colour.kt


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
// SPDX-FileCopyrightText: Adam Evyčędo
//
// SPDX-License-Identifier: GPL-3.0-or-later

package xyz.apiote.bimba.czwek.repo

import xyz.apiote.bimba.czwek.api.ColourV1

data class Colour(val R: UByte, val G: UByte, val B: UByte) {
	constructor(c: ColourV1) : this(c.R, c.G, c.B)

	fun toInt(): Int {
		var rgb = 0xff
		rgb = (rgb shl 8) + R.toInt()
		rgb = (rgb shl 8) + G.toInt()
		rgb = (rgb shl 8) + B.toInt()
		return rgb
	}
}