@@ -44,7 +44,7 @@ class GraphWidget(
4444
4545 val unitsPerChar = (highEdge - lowEdge) / (lines * linesMultiplier)
4646
47- // fun bitrateToLineheight(bitrate: Long): Int = (bitrate / unitsPerChar).toInt()
47+ // fun bitrateToLineheight(bitrate: Long): Int = (bitrate / unitsPerChar).toInt()
4848 fun BitrateFrame.toLineHeight () = (bitrate / unitsPerChar).toInt()
4949
5050// val lineHeights = frames.takeLast((width - 10) * 2).mapIndexed { i, frame ->
@@ -56,12 +56,14 @@ class GraphWidget(
5656// val currentValue = frames.last().bitrate
5757 val warnHeight = warningLine / unitsPerChar
5858
59- fun colorForHeightWithWarning (lineHeight : Int ) = if (lineHeight / linesMultiplier < warnHeight / linesMultiplier) {
60- TextColors .hsv(((lines - lineHeight / linesMultiplier) * - 12 ) % 360 , 1 , 1 ) + TextColors .black.bg
61- } else {
62- TextColors .black + TextColors .hsv(((lines - lineHeight / linesMultiplier) * - 12 ) % 360 , 1 , 1 ).bg
63- }
64- fun colorForHeight (lineHeight : Int ) = TextColors .hsv(((lines - lineHeight) * - 12 ) % 360 , 1 , 1 )
59+ fun colorForHeightWithWarning (lineHeight : Int ) =
60+ if (lineHeight / linesMultiplier < warnHeight / linesMultiplier) {
61+ TextColors .hsv(((lines - lineHeight / linesMultiplier) * - 12 ) % 360 , 1 , 1 ) + TextColors .black.bg
62+ } else {
63+ TextColors .black + TextColors .hsv(((lines - lineHeight / linesMultiplier) * - 12 ) % 360 , 1 , 1 ).bg
64+ }
65+
66+ fun colorForHeight (lineHeight : Int ) = TextColors .hsv(((lines - lineHeight) * - 12 ) % 360 , 1 , 1 )
6567
6668
6769 val frames = frames.takeLast(240 )
@@ -161,8 +163,6 @@ class GraphWidget(
161163// value < warningLine -> if(frameIndex%2 == 0) TextColors.white else TextColors.brightWhite
162164 else -> {
163165 error(" " )
164- // TextStyle()
165- // if (frameIndex % 2 == 0) TextColors.white else TextColors.gray
166166 }
167167 }
168168
@@ -174,47 +174,55 @@ class GraphWidget(
174174 row2 -> " ⠑"
175175 row3 -> " ⠱"
176176 row4 -> " ⢱"
177- null , in 0 .. row1, in (row4 + 1 ).. Int .MAX_VALUE -> " ⠁"
178- else -> error( " " )
177+ // null, in 0..row1, in (row4 + 1)..Int.MAX_VALUE -> "⠁"
178+ else -> " ⠁ "
179179 }
180180
181181 row2 -> when (rightHeight) {
182182 row1 -> " ⠊"
183183 row2 -> " ⠒"
184184 row3 -> " ⠢"
185185 row4 -> " ⢢"
186- null , in 0 .. < row1, in (row4 + 1 ).. Int .MAX_VALUE -> " ⠂"
187- else -> error( " " )
186+ // null, in 0..<row1, in (row4 + 1)..Int.MAX_VALUE -> "⠂"
187+ else -> " ⠂ "
188188 }
189189
190190 row3 -> when (rightHeight) {
191191 row1 -> " ⠎"
192192 row2 -> " ⠔"
193193 row3 -> " ⠤"
194194 row4 -> " ⢄"
195- null , in 0 .. < row1, in (row4 + 1 ).. Int .MAX_VALUE -> " ⠄"
196- else -> error( " " )
195+ // null, in 0..<row1, in (row4 + 1)..Int.MAX_VALUE -> "⠄"
196+ else -> " ⠄ "
197197 }
198198
199199 row4 -> when (rightHeight) {
200200 row1 -> " ⡎"
201201 row2 -> " ⡔"
202202 row3 -> " ⡠"
203203 row4 -> " ⣀"
204- null , in 0 .. < row1, in (row4 + 1 ).. Int .MAX_VALUE -> " ⡀"
205- else -> error( " " )
204+ // null, in 0..<row1, in (row4 + 1)..Int.MAX_VALUE -> "⡀"
205+ else -> " ⡀ "
206206 }
207207
208- null , in 0 .. < row1, in row4.. Int .MAX_VALUE -> when (rightHeight) {
208+ // null, in 0..<row1, in (row4 + 1)..Int.MAX_VALUE -> when (rightHeight) {
209+ // row1 -> "⠈"
210+ // row2 -> "⠐"
211+ // row3 -> "⠠"
212+ // row4 -> "⢀"
213+ // null, in 0..<row1, in (row4 + 1)..Int.MAX_VALUE -> " "
214+ // else -> " "
215+ // }
216+ else -> when (rightHeight) {
209217 row1 -> " ⠈"
210218 row2 -> " ⠐"
211219 row3 -> " ⠠"
212220 row4 -> " ⢀"
213- null , in 0 .. < row1, in (row4 + 1 ).. Int .MAX_VALUE -> " "
214- else -> error( " " )
221+ // null, in 0..<row1, in (row4 + 1)..Int.MAX_VALUE -> " "
222+ else -> " "
215223 }
216224
217- else -> error(" " )
225+ // else -> error("")
218226 }
219227 if (glyph == " " ) {
220228 Span .space(1 , style)
0 commit comments