Replace toRGB/toARGB with toBGR/toBGRA

This commit is contained in:
DBotThePony 2024-05-16 17:41:36 +07:00
parent 4e54cc7d67
commit dc47b3a13e
Signed by: DBot
GPG Key ID: DCC23B5715498507
12 changed files with 15 additions and 15 deletions

View File

@ -372,5 +372,5 @@ fun IMatteryEnergyStorage.getBarColor(): Int {
if (!maxBatteryLevel.isPositive)
return 0
return RGBAColor.LOW_POWER.linearInterpolation((batteryLevel / maxBatteryLevel).toFloat(), RGBAColor.FULL_POWER).toRGB()
return RGBAColor.LOW_POWER.linearInterpolation((batteryLevel / maxBatteryLevel).toFloat(), RGBAColor.FULL_POWER).toBGR()
}

View File

@ -123,7 +123,7 @@ fun IMatterStorage.getBarWidth(): Int {
}
fun IMatterStorage.getBarColor(): Int {
return RGBAColor.LOW_MATTER.linearInterpolation((storedMatter / maxStoredMatter).toFloat(), RGBAColor.FULL_MATTER).toRGB()
return RGBAColor.LOW_MATTER.linearInterpolation((storedMatter / maxStoredMatter).toFloat(), RGBAColor.FULL_MATTER).toBGR()
}
val ICapabilityProvider.matter: IMatterStorage? get() = getCapability(MatteryCapability.MATTER).orNull()

View File

@ -73,7 +73,7 @@ fun IPatternStorage.getBarWidth(): Int {
}
fun IPatternStorage.getBarColor(): Int {
return RGBAColor.LOW_PATTERNS.linearInterpolation((storedPatterns / patternCapacity).toFloat(), RGBAColor.FULL_PATTERNS).toRGB()
return RGBAColor.LOW_PATTERNS.linearInterpolation((storedPatterns / patternCapacity).toFloat(), RGBAColor.FULL_PATTERNS).toBGR()
}
val ICapabilityProvider.patterns: IPatternStorage? get() = getCapability(MatteryCapability.PATTERN).orNull()

View File

@ -168,7 +168,7 @@ private fun Font.drawInternal(
text,
(x + shadowX) * inv,
(y + shadowY) * inv,
shadowColor.toRGB(),
shadowColor.toBGR(),
false,
poseStack.last().pose(),
buffer,
@ -192,7 +192,7 @@ private fun Font.drawInternal(
text,
x * inv + _x,
y * inv + _y,
outlineColor.toRGB(),
outlineColor.toBGR(),
drawShadow,
poseStack.last().pose(),
buffer,
@ -211,7 +211,7 @@ private fun Font.drawInternal(
text,
x * inv,
y * inv,
color.toRGB(),
color.toBGR(),
drawShadow,
poseStack.last().pose(),
buffer,

View File

@ -55,7 +55,7 @@ object MatterBottlerProvider : IBlockComponentProvider, IServerDataProvider<Bloc
elementHelper.progress(
data.getFloat("workProgress"),
null,
elementHelper.progressStyle().color(RGBAColor.WHITE.toARGB()),
elementHelper.progressStyle().color(RGBAColor.WHITE.toBGRA()),
BoxStyle.getNestedBox(),
true
)

View File

@ -56,7 +56,7 @@ object MatterReconstructorProvider : IBlockComponentProvider, IServerDataProvide
damage,
maxDamage
),
elementHelper.progressStyle().color(RGBAColor.DARK_GREEN.toARGB()).textColor(RGBAColor.WHITE.toARGB()),
elementHelper.progressStyle().color(RGBAColor.DARK_GREEN.toBGRA()).textColor(RGBAColor.WHITE.toBGRA()),
BoxStyle.getNestedBox(),
true
)

View File

@ -68,7 +68,7 @@ object MatterStorageProvider : IBlockComponentProvider, IServerDataProvider<Bloc
storedMatter.formatMatter(),
maxStoredMatter.formatMatter()
),
elementHelper.progressStyle().color(JadeColors.MATTER_COLOR.toARGB()).textColor(RGBAColor.WHITE.toARGB()),
elementHelper.progressStyle().color(JadeColors.MATTER_COLOR.toBGRA()).textColor(RGBAColor.WHITE.toBGRA()),
BoxStyle.getNestedBox(),
true
)

View File

@ -66,7 +66,7 @@ object MatteryEnergyProvider : IBlockComponentProvider, IServerDataProvider<Bloc
batteryLevel.formatPower(),
maxBatteryLevel.formatPower()
),
elementHelper.progressStyle().color(JadeColors.ENERGY_COLOR.toARGB(), JadeColors.ENERGY_COLOR2.toARGB()).textColor(RGBAColor.WHITE.toARGB()),
elementHelper.progressStyle().color(JadeColors.ENERGY_COLOR.toBGRA(), JadeColors.ENERGY_COLOR2.toBGRA()).textColor(RGBAColor.WHITE.toBGRA()),
BoxStyle.getNestedBox(),
true
)

View File

@ -55,8 +55,8 @@ object MatteryWorkerProvider : IBlockComponentProvider, IServerDataProvider<Bloc
val workerData = data.getCompound(JadeTagKeys.MATTERY_WORKER_DATA)
val elementHelper = IElementHelper.get()
val style = elementHelper.progressStyle().color(RGBAColor.WHITE.toARGB())
val styleError = elementHelper.progressStyle().color(RGBAColor.REDDISH.toARGB())
val style = elementHelper.progressStyle().color(RGBAColor.WHITE.toBGRA())
val styleError = elementHelper.progressStyle().color(RGBAColor.REDDISH.toBGRA())
for (job in workerData.getCompoundList("jobs")) {
val progress = job.getFloat("workProgress")

View File

@ -82,7 +82,7 @@ class TritaniumArmorItem(slot: Type) : DyeableArmorItem(TritaniumArmorMaterial,
}
companion object {
val TRITANIUM_COLOR = RGBAColor(157, 187, 204).toARGB()
val TRITANIUM_COLOR = RGBAColor(157, 187, 204).toBGRA()
const val TEXTURE_LOCATION_BASE = "${OverdriveThatMatters.MOD_ID}:textures/models/armor/tritanium_armor_base.png"
const val TEXTURE_LOCATION_OVERLAY = "${OverdriveThatMatters.MOD_ID}:textures/models/armor/tritanium_armor_overlay.png"

View File

@ -40,7 +40,7 @@ object MBlockColors {
return DEFAULT_HOLO_SIGN_TINT
val blockEntity = light.getBlockEntity(pos) as? HoloSignBlockEntity ?: return DEFAULT_HOLO_SIGN_TINT
return RGBAColor(blockEntity.textRed, blockEntity.textGreen, blockEntity.textBlue, blockEntity.textAlpha).toRGB()
return RGBAColor(blockEntity.textRed, blockEntity.textGreen, blockEntity.textBlue, blockEntity.textAlpha).toBGR()
}
override fun getColor(itemStack: ItemStack, index: Int): Int {

View File

@ -415,7 +415,7 @@ object MRegistry : IBlockItemRegistryAcceptor {
event.register({ stack, layer -> if (layer == 0) (stack.item as DyeableArmorItem).getColor(stack) else -1 },
*MItems.TRITANIUM_ARMOR.toTypedArray()
)
event.register({ _, layer -> if (layer == 1) RGBAColor.AQUA.toARGB() else -1 },
event.register({ _, layer -> if (layer == 1) RGBAColor.AQUA.toBGRA() else -1 },
*MItems.MachineUpgrades.Creative.LIST.toTypedArray())
}