asHTML method
Returns a <div>
with a visual palette of colors _basicColors
.
Implementation
String asHTML(
{int? colorWidth,
int? colorHeight,
int colorMargin = 5,
bool inlineBlock = false}) {
colorWidth ??= colorHeight;
colorHeight ??= colorWidth;
colorWidth ??= 20;
colorHeight ??= colorWidth;
var styleDisplay = inlineBlock ? 'display: inline-block ;' : '';
var html = '<div style="$styleDisplay">';
for (var color in _basicColors) {
html +=
'<div style="display: inline-block ; background-color: ${color.toString()} ; margin: ${colorMargin}px ; width: ${colorWidth}px ; height: ${colorHeight}px"></div>';
}
html += '</div>';
return html;
}