@@ -171,15 +171,15 @@ internal fun AnyFrame.toHtmlData(
171
171
}
172
172
val renderConfig = configuration.copy(decimalFormat = format)
173
173
val contents = values.map {
174
- val value = it[ col]
174
+ val value = col[it ]
175
175
val content = value.toDataFrameLikeOrNull()
176
176
if (content != null ) {
177
177
val df = content.df()
178
178
if (df.isEmpty()) {
179
179
HtmlContent (" " , null )
180
180
} else {
181
181
val id = nextTableId()
182
- queue.add( RenderingQueueItem (df, id, content.configuration(defaultConfiguration) ))
182
+ queue + = RenderingQueueItem (df, id, content.configuration(defaultConfiguration))
183
183
DataFrameReference (id, df.size)
184
184
}
185
185
} else {
@@ -189,6 +189,21 @@ internal fun AnyFrame.toHtmlData(
189
189
?.invoke(FormattingDsl , it, col)
190
190
?.attributes()
191
191
?.ifEmpty { null }
192
+ ?.flatMap {
193
+ if (it.first == " color" ) {
194
+ // override all --text-color* variables that
195
+ // are used to color text of .numbers, .null, etc., inside DataFrame
196
+ listOf (
197
+ it,
198
+ " --text-color" to " ${it.second} !important" ,
199
+ " --text-color-dark" to " ${it.second} !important" ,
200
+ " --text-color-pale" to " ${it.second} !important" ,
201
+ " --text-color-medium" to " ${it.second} !important" ,
202
+ )
203
+ } else {
204
+ listOf (it)
205
+ }
206
+ }
192
207
?.joinToString(" ;" ) { " ${it.first} :${it.second} " }
193
208
HtmlContent (html, style)
194
209
}
@@ -207,7 +222,7 @@ internal fun AnyFrame.toHtmlData(
207
222
}
208
223
209
224
val rootId = nextTableId()
210
- queue.add( RenderingQueueItem (this , rootId, defaultConfiguration) )
225
+ queue + = RenderingQueueItem (this , rootId, defaultConfiguration)
211
226
while (! queue.isEmpty()) {
212
227
val (nextDf, nextId, configuration) = queue.pop()
213
228
val rowsLimit = if (nextId == rootId) configuration.rowsLimit else configuration.nestedRowsLimit
0 commit comments