mirror of
https://github.com/edg-l/edlang.git
synced 2024-11-22 16:08:24 +00:00
516 lines
95 KiB
HTML
516 lines
95 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A trait to apply styling to any value. Implemented for all types."><title>Paint in yansi - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-dd39b87e5fcfba68.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="yansi" data-themes="" data-resource-suffix="" data-rustdoc-version="1.80.0 (051478957 2024-07-21)" data-channel="1.80.0" data-search-js="search-d52510db62a78183.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-118b08c4c78b968e.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-20a3ad099b048cf2.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-df360f571f6edeae.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button><a class="logo-container" href="../yansi/index.html"><img src="https://raw.githubusercontent.com/SergioBenitez/yansi/master/.github/yansi-logo.png" alt=""></a></nav><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../yansi/index.html"><img src="https://raw.githubusercontent.com/SergioBenitez/yansi/master/.github/yansi-logo.png" alt="logo"></a><h2><a href="../yansi/index.html">yansi</a><span class="version">1.0.1</span></h2></div><h2 class="location"><a href="#">Paint</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.attr">attr</a></li><li><a href="#tymethod.bg">bg</a></li><li><a href="#tymethod.black">black</a></li><li><a href="#tymethod.blink">blink</a></li><li><a href="#tymethod.blue">blue</a></li><li><a href="#tymethod.bold">bold</a></li><li><a href="#tymethod.bright">bright</a></li><li><a href="#tymethod.bright_black">bright_black</a></li><li><a href="#tymethod.bright_blue">bright_blue</a></li><li><a href="#tymethod.bright_cyan">bright_cyan</a></li><li><a href="#tymethod.bright_green">bright_green</a></li><li><a href="#tymethod.bright_magenta">bright_magenta</a></li><li><a href="#tymethod.bright_red">bright_red</a></li><li><a href="#tymethod.bright_white">bright_white</a></li><li><a href="#tymethod.bright_yellow">bright_yellow</a></li><li><a href="#tymethod.clear">clear</a></li><li><a href="#tymethod.conceal">conceal</a></li><li><a href="#tymethod.cyan">cyan</a></li><li><a href="#tymethod.dim">dim</a></li><li><a href="#tymethod.fg">fg</a></li><li><a href="#tymethod.fixed">fixed</a></li><li><a href="#tymethod.green">green</a></li><li><a href="#tymethod.invert">invert</a></li><li><a href="#tymethod.italic">italic</a></li><li><a href="#tymethod.linger">linger</a></li><li><a href="#tymethod.magenta">magenta</a></li><li><a href="#tymethod.mask">mask</a></li><li><a href="#tymethod.on_black">on_black</a></li><li><a href="#tymethod.on_blue">on_blue</a></li><li><a href="#tymethod.on_bright">on_bright</a></li><li><a href="#tymethod.on_bright_black">on_bright_black</a></li><li><a href="#tymethod.on_bright_blue">on_bright_blue</a></li><li><a href="#tymethod.on_bright_cyan">on_bright_cyan</a></li><li><a href="#tymethod.on_bright_green">on_bright_green</a></li><li><a href="#tymethod.on_bright_magenta">on_bright_magenta</a></li><li><a href="#tymethod.on_bright_red">on_bright_red</a></li><li><a href="#tymethod.on_bright_white">on_bright_white</a></li><li><a href="#tymethod.on_bright_yellow">on_bright_yellow</a></li><li><a href="#tymethod.on_cyan">on_cyan</a></li><li><a href="#tymethod.on_fixed">on_fixed</a></li><li><a href="#tymethod.on_green">on_green</a></li><li><a href="#tymethod.on_magenta">on_magenta</a></li><li><a href="#tymethod.on_primary">on_primary</a></li><li><a href="#tymethod.on_red">on_red</a></li><li><a href="#tymethod.on_rgb">on_rgb</a></li><li><a href="#tymethod.on_white">on_white</a></li><li><a href="#tymethod.on_yellow">on_yellow</a></li><li><a href="#tymethod.primary">primary</a></li><li><a href="#tymethod.quirk">quirk</a></li><li><a href="#tymethod.rapid_blink">rapid_blink</a></li><li><a href="#tymethod.red">red</a></li><li><a href="#tymethod.resetting">resetting</a></li><li><a href="#tymethod.rgb">rgb</a></li><li><a href="#tymethod.strike">strike</a></li><li><a href="#tymethod.underline">underline</a></li><li><a href="#tymethod.whenever">whenever</a></li><li><a href="#tymethod.white">white</a></li><li><a href="#tymethod.wrap">wrap</a></li><li><a href="#tymethod.yellow">yellow</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.new">new</a></li><li><a href="#method.paint">paint</a></li></ul><h3><a href="#object-safety">Object Safety</a></h3><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In crate yansi</a></h2></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="index.html">yansi</a>::<wbr><a class="trait" href="#">Paint</a><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><span class="out-of-band"><a class="src" href="../src/yansi/paint.rs.html#92-131">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub trait Paint {
|
|
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 61 methods</span></summary> // Required methods
|
|
fn <a href="#tymethod.fg" class="fn">fg</a>(&self, value: <a class="enum" href="enum.Color.html" title="enum yansi::Color">Color</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.primary" class="fn">primary</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.fixed" class="fn">fixed</a>(&self, color: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.rgb" class="fn">rgb</a>(&self, r: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>, g: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>, b: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.black" class="fn">black</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.red" class="fn">red</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.green" class="fn">green</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.yellow" class="fn">yellow</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.blue" class="fn">blue</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.magenta" class="fn">magenta</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.cyan" class="fn">cyan</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.white" class="fn">white</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bright_black" class="fn">bright_black</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bright_red" class="fn">bright_red</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bright_green" class="fn">bright_green</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bright_yellow" class="fn">bright_yellow</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bright_blue" class="fn">bright_blue</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bright_magenta" class="fn">bright_magenta</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bright_cyan" class="fn">bright_cyan</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bright_white" class="fn">bright_white</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bg" class="fn">bg</a>(&self, value: <a class="enum" href="enum.Color.html" title="enum yansi::Color">Color</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_primary" class="fn">on_primary</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_fixed" class="fn">on_fixed</a>(&self, color: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_rgb" class="fn">on_rgb</a>(&self, r: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>, g: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>, b: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_black" class="fn">on_black</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_red" class="fn">on_red</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_green" class="fn">on_green</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_yellow" class="fn">on_yellow</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_blue" class="fn">on_blue</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_magenta" class="fn">on_magenta</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_cyan" class="fn">on_cyan</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_white" class="fn">on_white</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_bright_black" class="fn">on_bright_black</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_bright_red" class="fn">on_bright_red</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_bright_green" class="fn">on_bright_green</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_bright_yellow" class="fn">on_bright_yellow</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_bright_blue" class="fn">on_bright_blue</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_bright_magenta" class="fn">on_bright_magenta</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_bright_cyan" class="fn">on_bright_cyan</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_bright_white" class="fn">on_bright_white</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.attr" class="fn">attr</a>(&self, value: <a class="enum" href="enum.Attribute.html" title="enum yansi::Attribute">Attribute</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bold" class="fn">bold</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.dim" class="fn">dim</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.italic" class="fn">italic</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.underline" class="fn">underline</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.blink" class="fn">blink</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.rapid_blink" class="fn">rapid_blink</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.invert" class="fn">invert</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.conceal" class="fn">conceal</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.strike" class="fn">strike</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.quirk" class="fn">quirk</a>(&self, value: <a class="enum" href="enum.Quirk.html" title="enum yansi::Quirk">Quirk</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.mask" class="fn">mask</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.wrap" class="fn">wrap</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.linger" class="fn">linger</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.clear" class="fn">clear</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.resetting" class="fn">resetting</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.bright" class="fn">bright</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.on_bright" class="fn">on_bright</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.whenever" class="fn">whenever</a>(&self, value: <a class="struct" href="struct.Condition.html" title="struct yansi::Condition">Condition</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>>;
|
|
|
|
// Provided methods
|
|
fn <a href="#method.new" class="fn">new</a>(self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><Self>
|
|
<span class="where">where Self: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span> { ... }
|
|
<span class="item-spacer"></span> fn <a href="#method.paint" class="fn">paint</a><S: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="struct.Style.html" title="struct yansi::Style">Style</a>>>(&self, style: S) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>> { ... }
|
|
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A trait to apply styling to any value. Implemented for all types.</p>
|
|
<p>Because this trait is implemented for all types, you can use its methods on
|
|
any type. With the exception of one constructor method, <a href="trait.Paint.html#method.new" title="method yansi::Paint::new"><code>Paint::new()</code></a>,
|
|
all methods are called with method syntax:</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::Paint;
|
|
|
|
<span class="string">"hello"</span>.green(); <span class="comment">// calls `Paint::<&'static str>::green()`.
|
|
</span><span class="string">"hello"</span>.strike(); <span class="comment">// calls `Paint::<&'static str>::strike()`.
|
|
</span><span class="number">1</span>.on_red(); <span class="comment">// calls `Paint::<i32>::red()`.
|
|
</span><span class="number">1</span>.blink(); <span class="comment">// calls `Paint::<i32>::blink()`.</span></code></pre></div>
|
|
<h4 id="chaining"><a class="doc-anchor" href="#chaining">§</a>Chaining</h4>
|
|
<p>All methods return a <a href="struct.Painted.html" title="struct yansi::Painted"><code>Painted</code></a> whose methods are exactly those of <code>Paint</code>.
|
|
This means you can chain <code>Paint</code> method calls:</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::Paint;
|
|
|
|
<span class="string">"hello"</span>.green().strike(); <span class="comment">// calls `Paint::green()` then `Painted::strike()`.
|
|
</span><span class="number">1</span>.on_red().blink(); <span class="comment">// calls `Paint::red()` + `Painted::blink()`.</span></code></pre></div>
|
|
<h4 id="borrow-vs-owned-receiver"><a class="doc-anchor" href="#borrow-vs-owned-receiver">§</a>Borrow vs. Owned Receiver</h4>
|
|
<p>The returned <a href="struct.Painted.html" title="struct yansi::Painted"><code>Painted</code></a> type contains a borrow to the receiver:</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::{Paint, Painted};
|
|
|
|
<span class="kw">let </span>v: Painted<<span class="kw-2">&</span>i32> = <span class="number">1</span>.red();</code></pre></div>
|
|
<p>This is nearly always what you want. In the exceedingly rare case that you
|
|
<em>do</em> want <code>Painted</code> to own its value, use <a href="trait.Paint.html#method.new" title="method yansi::Paint::new"><code>Paint::new()</code></a> or the equivalent
|
|
<a href="struct.Painted.html#method.new" title="associated function yansi::Painted::new"><code>Painted::new()</code></a>:</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::{Paint, Painted};
|
|
|
|
<span class="kw">let </span>v: Painted<i32> = Paint::new(<span class="number">1</span>);
|
|
<span class="kw">let </span>v: Painted<i32> = Painted::new(<span class="number">1</span>);</code></pre></div>
|
|
<h4 id="further-details"><a class="doc-anchor" href="#further-details">§</a>Further Details</h4>
|
|
<p>See the <a href="index.html#usage" title="mod yansi">crate level docs</a> for more details and examples.</p>
|
|
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.fg" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.fg" class="fn">fg</a>(&self, value: <a class="enum" href="enum.Color.html" title="enum yansi::Color">Color</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns a styled value derived from <code>self</code> with the foreground set to
|
|
<code>value</code>.</p>
|
|
<p>This method should be used rarely. Instead, prefer to use color-specific
|
|
builder methods like <a href="trait.Paint.html#tymethod.red"><code>red()</code></a> and
|
|
<a href="trait.Paint.html#tymethod.green"><code>green()</code></a>, which have the same functionality but are
|
|
pithier.</p>
|
|
<h5 id="example"><a class="doc-anchor" href="#example">§</a>Example</h5>
|
|
<p>Set foreground color to white using <code>fg()</code>:</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::{Paint, Color};
|
|
|
|
painted.fg(Color::White);</code></pre></div>
|
|
<p>Set foreground color to white using <a href="trait.Paint.html#tymethod.white"><code>white()</code></a>.</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::Paint;
|
|
|
|
painted.white();</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.primary" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.primary" class="fn">primary</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Primary" title="variant yansi::Color::Primary"><code>Color::Primary</code></a>.</p>
|
|
<h5 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.primary());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.fixed" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.fixed" class="fn">fixed</a>(&self, color: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Fixed" title="variant yansi::Color::Fixed"><code>Color::Fixed</code></a>.</p>
|
|
<h5 id="example-2"><a class="doc-anchor" href="#example-2">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.fixed(color));</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.rgb" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.rgb" class="fn">rgb</a>(&self, r: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>, g: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>, b: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Rgb" title="variant yansi::Color::Rgb"><code>Color::Rgb</code></a>.</p>
|
|
<h5 id="example-3"><a class="doc-anchor" href="#example-3">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.rgb(r, g, b));</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.black" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.black" class="fn">black</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Black" title="variant yansi::Color::Black"><code>Color::Black</code></a>.</p>
|
|
<h5 id="example-4"><a class="doc-anchor" href="#example-4">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.black());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.red" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.red" class="fn">red</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Red" title="variant yansi::Color::Red"><code>Color::Red</code></a>.</p>
|
|
<h5 id="example-5"><a class="doc-anchor" href="#example-5">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.red());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.green" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.green" class="fn">green</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Green" title="variant yansi::Color::Green"><code>Color::Green</code></a>.</p>
|
|
<h5 id="example-6"><a class="doc-anchor" href="#example-6">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.green());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.yellow" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.yellow" class="fn">yellow</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Yellow" title="variant yansi::Color::Yellow"><code>Color::Yellow</code></a>.</p>
|
|
<h5 id="example-7"><a class="doc-anchor" href="#example-7">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.yellow());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.blue" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.blue" class="fn">blue</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Blue" title="variant yansi::Color::Blue"><code>Color::Blue</code></a>.</p>
|
|
<h5 id="example-8"><a class="doc-anchor" href="#example-8">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.blue());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.magenta" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.magenta" class="fn">magenta</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Magenta" title="variant yansi::Color::Magenta"><code>Color::Magenta</code></a>.</p>
|
|
<h5 id="example-9"><a class="doc-anchor" href="#example-9">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.magenta());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.cyan" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.cyan" class="fn">cyan</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Cyan" title="variant yansi::Color::Cyan"><code>Color::Cyan</code></a>.</p>
|
|
<h5 id="example-10"><a class="doc-anchor" href="#example-10">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.cyan());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.white" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.white" class="fn">white</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.White" title="variant yansi::Color::White"><code>Color::White</code></a>.</p>
|
|
<h5 id="example-11"><a class="doc-anchor" href="#example-11">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.white());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.bright_black" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.bright_black" class="fn">bright_black</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightBlack" title="variant yansi::Color::BrightBlack"><code>Color::BrightBlack</code></a>.</p>
|
|
<h5 id="example-12"><a class="doc-anchor" href="#example-12">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.bright_black());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.bright_red" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.bright_red" class="fn">bright_red</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightRed" title="variant yansi::Color::BrightRed"><code>Color::BrightRed</code></a>.</p>
|
|
<h5 id="example-13"><a class="doc-anchor" href="#example-13">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.bright_red());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.bright_green" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.bright_green" class="fn">bright_green</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightGreen" title="variant yansi::Color::BrightGreen"><code>Color::BrightGreen</code></a>.</p>
|
|
<h5 id="example-14"><a class="doc-anchor" href="#example-14">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.bright_green());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.bright_yellow" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.bright_yellow" class="fn">bright_yellow</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightYellow" title="variant yansi::Color::BrightYellow"><code>Color::BrightYellow</code></a>.</p>
|
|
<h5 id="example-15"><a class="doc-anchor" href="#example-15">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.bright_yellow());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.bright_blue" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.bright_blue" class="fn">bright_blue</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightBlue" title="variant yansi::Color::BrightBlue"><code>Color::BrightBlue</code></a>.</p>
|
|
<h5 id="example-16"><a class="doc-anchor" href="#example-16">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.bright_blue());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.bright_magenta" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.bright_magenta" class="fn">bright_magenta</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightMagenta" title="variant yansi::Color::BrightMagenta"><code>Color::BrightMagenta</code></a>.</p>
|
|
<h5 id="example-17"><a class="doc-anchor" href="#example-17">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.bright_magenta());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.bright_cyan" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.bright_cyan" class="fn">bright_cyan</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightCyan" title="variant yansi::Color::BrightCyan"><code>Color::BrightCyan</code></a>.</p>
|
|
<h5 id="example-18"><a class="doc-anchor" href="#example-18">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.bright_cyan());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.bright_white" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.bright_white" class="fn">bright_white</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.fg"><code>fg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightWhite" title="variant yansi::Color::BrightWhite"><code>Color::BrightWhite</code></a>.</p>
|
|
<h5 id="example-19"><a class="doc-anchor" href="#example-19">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.bright_white());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.bg" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.bg" class="fn">bg</a>(&self, value: <a class="enum" href="enum.Color.html" title="enum yansi::Color">Color</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns a styled value derived from <code>self</code> with the background set to
|
|
<code>value</code>.</p>
|
|
<p>This method should be used rarely. Instead, prefer to use color-specific
|
|
builder methods like <a href="trait.Paint.html#tymethod.on_red"><code>on_red()</code></a> and
|
|
<a href="trait.Paint.html#tymethod.on_green"><code>on_green()</code></a>, which have the same functionality but
|
|
are pithier.</p>
|
|
<h5 id="example-20"><a class="doc-anchor" href="#example-20">§</a>Example</h5>
|
|
<p>Set background color to red using <code>fg()</code>:</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::{Paint, Color};
|
|
|
|
painted.bg(Color::Red);</code></pre></div>
|
|
<p>Set background color to red using <a href="trait.Paint.html#tymethod.on_red"><code>on_red()</code></a>.</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::Paint;
|
|
|
|
painted.on_red();</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_primary" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_primary" class="fn">on_primary</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Primary" title="variant yansi::Color::Primary"><code>Color::Primary</code></a>.</p>
|
|
<h5 id="example-21"><a class="doc-anchor" href="#example-21">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_primary());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_fixed" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_fixed" class="fn">on_fixed</a>(&self, color: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Fixed" title="variant yansi::Color::Fixed"><code>Color::Fixed</code></a>.</p>
|
|
<h5 id="example-22"><a class="doc-anchor" href="#example-22">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_fixed(color));</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_rgb" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_rgb" class="fn">on_rgb</a>(&self, r: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>, g: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>, b: <a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.u8.html">u8</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Rgb" title="variant yansi::Color::Rgb"><code>Color::Rgb</code></a>.</p>
|
|
<h5 id="example-23"><a class="doc-anchor" href="#example-23">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_rgb(r, g, b));</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_black" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_black" class="fn">on_black</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Black" title="variant yansi::Color::Black"><code>Color::Black</code></a>.</p>
|
|
<h5 id="example-24"><a class="doc-anchor" href="#example-24">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_black());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_red" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_red" class="fn">on_red</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Red" title="variant yansi::Color::Red"><code>Color::Red</code></a>.</p>
|
|
<h5 id="example-25"><a class="doc-anchor" href="#example-25">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_red());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_green" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_green" class="fn">on_green</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Green" title="variant yansi::Color::Green"><code>Color::Green</code></a>.</p>
|
|
<h5 id="example-26"><a class="doc-anchor" href="#example-26">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_green());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_yellow" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_yellow" class="fn">on_yellow</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Yellow" title="variant yansi::Color::Yellow"><code>Color::Yellow</code></a>.</p>
|
|
<h5 id="example-27"><a class="doc-anchor" href="#example-27">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_yellow());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_blue" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_blue" class="fn">on_blue</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Blue" title="variant yansi::Color::Blue"><code>Color::Blue</code></a>.</p>
|
|
<h5 id="example-28"><a class="doc-anchor" href="#example-28">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_blue());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_magenta" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_magenta" class="fn">on_magenta</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Magenta" title="variant yansi::Color::Magenta"><code>Color::Magenta</code></a>.</p>
|
|
<h5 id="example-29"><a class="doc-anchor" href="#example-29">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_magenta());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_cyan" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_cyan" class="fn">on_cyan</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.Cyan" title="variant yansi::Color::Cyan"><code>Color::Cyan</code></a>.</p>
|
|
<h5 id="example-30"><a class="doc-anchor" href="#example-30">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_cyan());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_white" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_white" class="fn">on_white</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.White" title="variant yansi::Color::White"><code>Color::White</code></a>.</p>
|
|
<h5 id="example-31"><a class="doc-anchor" href="#example-31">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_white());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_bright_black" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_bright_black" class="fn">on_bright_black</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightBlack" title="variant yansi::Color::BrightBlack"><code>Color::BrightBlack</code></a>.</p>
|
|
<h5 id="example-32"><a class="doc-anchor" href="#example-32">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_bright_black());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_bright_red" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_bright_red" class="fn">on_bright_red</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightRed" title="variant yansi::Color::BrightRed"><code>Color::BrightRed</code></a>.</p>
|
|
<h5 id="example-33"><a class="doc-anchor" href="#example-33">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_bright_red());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_bright_green" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_bright_green" class="fn">on_bright_green</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightGreen" title="variant yansi::Color::BrightGreen"><code>Color::BrightGreen</code></a>.</p>
|
|
<h5 id="example-34"><a class="doc-anchor" href="#example-34">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_bright_green());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_bright_yellow" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_bright_yellow" class="fn">on_bright_yellow</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightYellow" title="variant yansi::Color::BrightYellow"><code>Color::BrightYellow</code></a>.</p>
|
|
<h5 id="example-35"><a class="doc-anchor" href="#example-35">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_bright_yellow());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_bright_blue" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_bright_blue" class="fn">on_bright_blue</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightBlue" title="variant yansi::Color::BrightBlue"><code>Color::BrightBlue</code></a>.</p>
|
|
<h5 id="example-36"><a class="doc-anchor" href="#example-36">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_bright_blue());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_bright_magenta" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_bright_magenta" class="fn">on_bright_magenta</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightMagenta" title="variant yansi::Color::BrightMagenta"><code>Color::BrightMagenta</code></a>.</p>
|
|
<h5 id="example-37"><a class="doc-anchor" href="#example-37">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_bright_magenta());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_bright_cyan" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_bright_cyan" class="fn">on_bright_cyan</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightCyan" title="variant yansi::Color::BrightCyan"><code>Color::BrightCyan</code></a>.</p>
|
|
<h5 id="example-38"><a class="doc-anchor" href="#example-38">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_bright_cyan());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_bright_white" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_bright_white" class="fn">on_bright_white</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.bg"><code>bg()</code></a>
|
|
set to
|
|
<a href="enum.Color.html#variant.BrightWhite" title="variant yansi::Color::BrightWhite"><code>Color::BrightWhite</code></a>.</p>
|
|
<h5 id="example-39"><a class="doc-anchor" href="#example-39">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_bright_white());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.attr" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.attr" class="fn">attr</a>(&self, value: <a class="enum" href="enum.Attribute.html" title="enum yansi::Attribute">Attribute</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Enables the styling <a href="enum.Attribute.html" title="enum yansi::Attribute"><code>Attribute</code></a> <code>value</code>.</p>
|
|
<p>This method should be used rarely. Instead, prefer to use
|
|
attribute-specific builder methods like <a href="trait.Paint.html#tymethod.bold"><code>bold()</code></a> and
|
|
<a href="trait.Paint.html#tymethod.underline"><code>underline()</code></a>, which have the same functionality
|
|
but are pithier.</p>
|
|
<h5 id="example-40"><a class="doc-anchor" href="#example-40">§</a>Example</h5>
|
|
<p>Make text bold using <code>attr()</code>:</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::{Paint, Attribute};
|
|
|
|
painted.attr(Attribute::Bold);</code></pre></div>
|
|
<p>Make text bold using using <a href="trait.Paint.html#tymethod.bold"><code>bold()</code></a>.</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::Paint;
|
|
|
|
painted.bold();</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.bold" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.bold" class="fn">bold</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.attr"><code>attr()</code></a>
|
|
set to
|
|
<a href="enum.Attribute.html#variant.Bold" title="variant yansi::Attribute::Bold"><code>Attribute::Bold</code></a>.</p>
|
|
<h5 id="example-41"><a class="doc-anchor" href="#example-41">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.bold());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.dim" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.dim" class="fn">dim</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.attr"><code>attr()</code></a>
|
|
set to
|
|
<a href="enum.Attribute.html#variant.Dim" title="variant yansi::Attribute::Dim"><code>Attribute::Dim</code></a>.</p>
|
|
<h5 id="example-42"><a class="doc-anchor" href="#example-42">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.dim());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.italic" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.italic" class="fn">italic</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.attr"><code>attr()</code></a>
|
|
set to
|
|
<a href="enum.Attribute.html#variant.Italic" title="variant yansi::Attribute::Italic"><code>Attribute::Italic</code></a>.</p>
|
|
<h5 id="example-43"><a class="doc-anchor" href="#example-43">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.italic());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.underline" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.underline" class="fn">underline</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.attr"><code>attr()</code></a>
|
|
set to
|
|
<a href="enum.Attribute.html#variant.Underline" title="variant yansi::Attribute::Underline"><code>Attribute::Underline</code></a>.</p>
|
|
<h5 id="example-44"><a class="doc-anchor" href="#example-44">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.underline());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.blink" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.blink" class="fn">blink</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.attr"><code>attr()</code></a>
|
|
set to
|
|
<a href="enum.Attribute.html#variant.Blink" title="variant yansi::Attribute::Blink"><code>Attribute::Blink</code></a>.</p>
|
|
<h5 id="example-45"><a class="doc-anchor" href="#example-45">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.blink());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.rapid_blink" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.rapid_blink" class="fn">rapid_blink</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.attr"><code>attr()</code></a>
|
|
set to
|
|
<a href="enum.Attribute.html#variant.RapidBlink" title="variant yansi::Attribute::RapidBlink"><code>Attribute::RapidBlink</code></a>.</p>
|
|
<h5 id="example-46"><a class="doc-anchor" href="#example-46">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.rapid_blink());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.invert" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.invert" class="fn">invert</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.attr"><code>attr()</code></a>
|
|
set to
|
|
<a href="enum.Attribute.html#variant.Invert" title="variant yansi::Attribute::Invert"><code>Attribute::Invert</code></a>.</p>
|
|
<h5 id="example-47"><a class="doc-anchor" href="#example-47">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.invert());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.conceal" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.conceal" class="fn">conceal</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.attr"><code>attr()</code></a>
|
|
set to
|
|
<a href="enum.Attribute.html#variant.Conceal" title="variant yansi::Attribute::Conceal"><code>Attribute::Conceal</code></a>.</p>
|
|
<h5 id="example-48"><a class="doc-anchor" href="#example-48">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.conceal());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.strike" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.strike" class="fn">strike</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.attr"><code>attr()</code></a>
|
|
set to
|
|
<a href="enum.Attribute.html#variant.Strike" title="variant yansi::Attribute::Strike"><code>Attribute::Strike</code></a>.</p>
|
|
<h5 id="example-49"><a class="doc-anchor" href="#example-49">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.strike());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.quirk" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.quirk" class="fn">quirk</a>(&self, value: <a class="enum" href="enum.Quirk.html" title="enum yansi::Quirk">Quirk</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Enables the <code>yansi</code> <a href="enum.Quirk.html" title="enum yansi::Quirk"><code>Quirk</code></a> <code>value</code>.</p>
|
|
<p>This method should be used rarely. Instead, prefer to use quirk-specific
|
|
builder methods like <a href="trait.Paint.html#tymethod.mask"><code>mask()</code></a> and
|
|
<a href="trait.Paint.html#tymethod.wrap"><code>wrap()</code></a>, which have the same functionality but are
|
|
pithier.</p>
|
|
<h5 id="example-50"><a class="doc-anchor" href="#example-50">§</a>Example</h5>
|
|
<p>Enable wrapping using <code>.quirk()</code>:</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::{Paint, Quirk};
|
|
|
|
painted.quirk(Quirk::Wrap);</code></pre></div>
|
|
<p>Enable wrapping using <a href="trait.Paint.html#tymethod.wrap"><code>wrap()</code></a>.</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::Paint;
|
|
|
|
painted.wrap();</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.mask" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.mask" class="fn">mask</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.quirk"><code>quirk()</code></a>
|
|
set to
|
|
<a href="enum.Quirk.html#variant.Mask" title="variant yansi::Quirk::Mask"><code>Quirk::Mask</code></a>.</p>
|
|
<h5 id="example-51"><a class="doc-anchor" href="#example-51">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.mask());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.wrap" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.wrap" class="fn">wrap</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.quirk"><code>quirk()</code></a>
|
|
set to
|
|
<a href="enum.Quirk.html#variant.Wrap" title="variant yansi::Quirk::Wrap"><code>Quirk::Wrap</code></a>.</p>
|
|
<h5 id="example-52"><a class="doc-anchor" href="#example-52">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.wrap());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.linger" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.linger" class="fn">linger</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.quirk"><code>quirk()</code></a>
|
|
set to
|
|
<a href="enum.Quirk.html#variant.Linger" title="variant yansi::Quirk::Linger"><code>Quirk::Linger</code></a>.</p>
|
|
<h5 id="example-53"><a class="doc-anchor" href="#example-53">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.linger());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.clear" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.clear" class="fn">clear</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 1.0.1: renamed to <code>resetting()</code> due to conflicts with <code>Vec::clear()</code>.
|
|
The <code>clear()</code> method will be removed in a future release.</span></div></span></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.quirk"><code>quirk()</code></a>
|
|
set to
|
|
<a href="enum.Quirk.html#variant.Clear" title="variant yansi::Quirk::Clear"><code>Quirk::Clear</code></a>.</p>
|
|
<h5 id="example-54"><a class="doc-anchor" href="#example-54">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.clear());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.resetting" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.resetting" class="fn">resetting</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.quirk"><code>quirk()</code></a>
|
|
set to
|
|
<a href="enum.Quirk.html#variant.Resetting" title="variant yansi::Quirk::Resetting"><code>Quirk::Resetting</code></a>.</p>
|
|
<h5 id="example-55"><a class="doc-anchor" href="#example-55">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.resetting());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.bright" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.bright" class="fn">bright</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.quirk"><code>quirk()</code></a>
|
|
set to
|
|
<a href="enum.Quirk.html#variant.Bright" title="variant yansi::Quirk::Bright"><code>Quirk::Bright</code></a>.</p>
|
|
<h5 id="example-56"><a class="doc-anchor" href="#example-56">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.bright());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.on_bright" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.on_bright" class="fn">on_bright</a>(&self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Returns <code>self</code> with the
|
|
<a href="trait.Paint.html#tymethod.quirk"><code>quirk()</code></a>
|
|
set to
|
|
<a href="enum.Quirk.html#variant.OnBright" title="variant yansi::Quirk::OnBright"><code>Quirk::OnBright</code></a>.</p>
|
|
<h5 id="example-57"><a class="doc-anchor" href="#example-57">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">println!</span>(<span class="string">"{}"</span>, value.on_bright());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.whenever" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#130">source</a><h4 class="code-header">fn <a href="#tymethod.whenever" class="fn">whenever</a>(&self, value: <a class="struct" href="struct.Condition.html" title="struct yansi::Condition">Condition</a>) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Conditionally enable styling based on whether the <a href="struct.Condition.html" title="struct yansi::Condition"><code>Condition</code></a> <code>value</code>
|
|
applies. Replaces any previous condition.</p>
|
|
<p>See the <a href="index.html#per-style" title="mod yansi">crate level docs</a> for more details.</p>
|
|
<h5 id="example-58"><a class="doc-anchor" href="#example-58">§</a>Example</h5>
|
|
<p>Enable styling <code>painted</code> only when both <code>stdout</code> and <code>stderr</code> are TTYs:</p>
|
|
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::{Paint, Condition};
|
|
|
|
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);</code></pre></div>
|
|
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.new" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#104-106">source</a><h4 class="code-header">fn <a href="#method.new" class="fn">new</a>(self) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><Self><div class="where">where
|
|
Self: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,</div></h4></section></summary><div class="docblock"><p>Create a new <a href="struct.Painted.html" title="struct yansi::Painted"><code>Painted</code></a> with a default <a href="struct.Style.html" title="struct yansi::Style"><code>Style</code></a>.</p>
|
|
<h5 id="example-59"><a class="doc-anchor" href="#example-59">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::Paint;
|
|
|
|
<span class="kw">let </span>painted = Paint::new(<span class="string">"hello"</span>);
|
|
<span class="macro">assert_eq!</span>(painted.style, yansi::Style::new());</code></pre></div>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.paint" class="method"><a class="src rightside" href="../src/yansi/paint.rs.html#126-128">source</a><h4 class="code-header">fn <a href="#method.paint" class="fn">paint</a><S: <a class="trait" href="https://doc.rust-lang.org/1.80.0/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="struct.Style.html" title="struct yansi::Style">Style</a>>>(&self, style: S) -> <a class="struct" href="struct.Painted.html" title="struct yansi::Painted">Painted</a><<a class="primitive" href="https://doc.rust-lang.org/1.80.0/std/primitive.reference.html">&Self</a>></h4></section></summary><div class="docblock"><p>Apply a style wholesale to <code>self</code>. Any previous style is replaced.</p>
|
|
<h5 id="example-60"><a class="doc-anchor" href="#example-60">§</a>Example</h5>
|
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>yansi::{Paint, Style, Color::<span class="kw-2">*</span>};
|
|
|
|
<span class="kw">static </span>DEBUG: Style = Black.bold().on_yellow();
|
|
|
|
<span class="kw">let </span>painted = <span class="string">"hello"</span>.paint(DEBUG);</code></pre></div>
|
|
</div></details></div><h2 id="object-safety" class="section-header">Object Safety<a href="#object-safety" class="anchor">§</a></h2><div class="object-safety-info">This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.80.0/reference/items/traits.html#object-safety">object safe</a>.</div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Paint-for-T" class="impl"><a class="src rightside" href="../src/yansi/paint.rs.html#134-136">source</a><a href="#impl-Paint-for-T" class="anchor">§</a><h3 class="code-header">impl<T: ?<a class="trait" href="https://doc.rust-lang.org/1.80.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>> <a class="trait" href="trait.Paint.html" title="trait yansi::Paint">Paint</a> for T</h3></section></div><script src="../trait.impl/yansi/paint/trait.Paint.js" async></script></section></div></main></body></html> |