Skip to content

Commit

Permalink
Use normal equality for ints in kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
MarmadileManteater committed Jan 29, 2025
1 parent c89709a commit 27bb0d3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package io.freetubeapp.freetube.helpers
import android.graphics.Color

fun String.hexToColour() : Int {
return if (length === 7) {
return if (length == 7) {
Color.rgb(
Integer.valueOf(substring(1, 3), 16),
Integer.valueOf(substring(3, 5), 16),
Integer.valueOf(substring(5, 7), 16)
)
} else if (length === 4) {
} else if (length == 4) {
val r = substring(1, 2)
val g = substring(2, 3)
val b = substring(3, 4)
Expand Down

0 comments on commit 27bb0d3

Please sign in to comment.