package ONO::Lib::UI::Label;
################################################################################
# COPYRIGHT / LICENSE #
################################################################################
#
# This file is part of the ONO Software Project.
#
# Copyright (C) 2000-2025 Jos KIRPS [ www.kirps.com | jos_AT_kirps_DOT_com ]
# and The Joopita Project [ www.joopita.org | contact_AT_joopita_DOT_com ]
#
# This file, as well as other parts of the ONO Software Project or related
# elements, are FREE SOFTWARE available under the ARTISTIC LICENSE 2.0.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# For the full license, see /ono/osr/license/LICENSE.txt, or write to
# jos_AT_kirps_DOT_com or contact_AT_joopita_DOT_com.
#
################################################################################
# END OF COPYRIGHT / LICENSE, HERE COMES THE CODE ... #
################################################################################
use strict;
###############################################################################
# manifest
###############################################################################
sub display {
#: Display a label, which is a colored circle containing a character.
#: Shape input is currently not used, circle is default.
my (
$self,
$shape,
$size,
$color,
$content,
) = @_;
my $size2 = $size-8;
my $size_half = int($size/2);
my ($STYLE,$CLASS);
if ($color =~ /^#/) {
$STYLE = qq~ style="background-color:$color"~;
} else {
$CLASS = qq~bg_$color ~;
}
return qq~<div class="bo bg_paper radius$size2 p5 center bold large colf block$size">
<div class="${CLASS}radius$size_half block$size"$STYLE>
<table class="wide_table" style="height:${size}px"><tr><td>$content</td></tr></table>
</div>
</div>
~;
}
###############################################################################
# end of script
###############################################################################
1;
__END__