{"id":7163,"date":"2022-12-20T19:35:41","date_gmt":"2022-12-20T22:35:41","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/cursesuicolor-man3\/"},"modified":"2022-12-20T19:35:41","modified_gmt":"2022-12-20T22:35:41","slug":"cursesuicolor-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/cursesuicolor-man3\/","title":{"rendered":"Curses::UI::Color (man3)"},"content":{"rendered":"<h1 align=\"center\">Curses::UI::Color<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#WARNING\">WARNING<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#METHODS\">METHODS<\/a><br \/> <a href=\"#USAGE\">USAGE<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Curses::UI::Color \u2212 Color support module<\/p>\n<h2>WARNING <a name=\"WARNING\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This is a development version. As I do not expect to change the interface during this time it may happen that the color behaviour (e.g. to what extend color is drawn in a window) may change or even the colors themselves. If you want something stable, use \u2212color_support => 0 , but you won\u2019t get those fency colors then :\u2212)<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This module provides all functions related to color support in Curses::UI. The color support was implemented without disturbing old applications, they will look as they used to do. Only if you enable color support explicitly and it is available on your terminal the color functions will have an effect.<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">my $cui = new Curses::UI(\u2212color_support => 1, <br \/> \u2212clear_on_exit => 0);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">my $mainw = $cui\u2212>add(\u2019screen\u2019, \u2019Window\u2019);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">$mainw\u2212>add(\u2019l\u2019,\u2019Label\u2019, \u2212bg => &#8220;white&#8221;, <br \/> \u2212fg => &#8220;blue&#8221;, <br \/> \u2212text => &#8220;Colored Label&#8221;);<\/p>\n<h2>METHODS <a name=\"METHODS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"49%\">\n<p style=\"margin-top: 1em\"><b>new<\/b> (\u2212default\u2212colors => <small>BOOLEAN<\/small> )<\/p>\n<\/td>\n<td width=\"34%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Creates a new Curses::UI::Color object, the option default colors define if the use_default_colors function of Curses is used. See Curses for that.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"21%\">\n<p style=\"margin-top: 1em\"><b>get_colors<\/b> ( )<\/p>\n<\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Returns all in this object defined colors as an array<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"15%\">\n<p style=\"margin-top: 1em\"><b>colors<\/b> ( )<\/p>\n<\/td>\n<td width=\"68%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Is true if color support is enabled.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"46%\">\n<p style=\"margin-top: 1em\"><b>define_color<\/b> ( <small>NAME, R, G, B<\/small> )<\/p>\n<\/td>\n<td width=\"37%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This function defines a new color in the Color object. The <small>RGB<\/small> values can be between 0 and 1000. Existing colors can be redefined.<\/p>\n<h2>USAGE <a name=\"USAGE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Curses::UI has 7 predefined colors: <br \/> black <br \/> red <br \/> green <br \/> yellow <br \/> blue <br \/> magenta <br \/> cyan <br \/> white<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Curses::UI with color support also defines some new options:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\u2212fg \u2212bg for general foreground and background color. <br \/> \u2212tfg \u2212tbg for widget title fg and bg color <br \/> \u2212bfg \u2212bbg for widget border fg and bg color <br \/> \u2212sfg \u2212sbg for scrollbar fg and bg color<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Every widget has has a runtime setter: <br \/> set_color_fg ( <small>COLOR<\/small> ) <br \/> set_colof_bg ( <small>COLOR<\/small> ) <br \/> set_color_tfg ( <small>COLOR<\/small> ) <br \/> set_colof_tbg ( <small>COLOR<\/small> ) <br \/> set_color_bfg ( <small>COLOR<\/small> ) <br \/> set_colof_bbg ( <small>COLOR<\/small> ) <br \/> set_color_sfg ( <small>COLOR<\/small> ) <br \/> set_colof_sbg ( <small>COLOR<\/small> )<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Mostly every widget has a \u2212fg and \u2212bg option to set the foreground and background color using the above color names. Own colors can be defined using the <b>define_color<\/b> method. Every widget that supports color by now has also two functions <b>set_color_fg<\/b> and <b>set_color_bg<\/b> to set or change the color at runtime. Widgets with borders and scrollbars can use \u2212bfg and \u2212bbg to set the foreground and background color of the border or the \u2212sfg and \u2212sbg option to set the colors of the scrollbar. Widgets with titles can set the \u2212tfg and \u2212tbg option to define the title foreground and background color.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Check also the examples\/color_editor for seeing what is possible at the moment.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Curses::UI<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Copyright (c) 2003 Marcus Thiesen. All rights reserved.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This package is free software and is provided &#8220;as is&#8221; without express or implied warranty. It may be used, redistributed and\/or modified under the same terms as perl itself.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Curses::UI::Color \u2212 Color support module <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3498,3007],"class_list":["post-7163","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-cursesuicolor","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7163"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7163\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}