deploy: 95756b1a57
This commit is contained in:
commit
0fa87f2b35
16382 changed files with 734838 additions and 0 deletions
91
cosmic/cosmic_theme/palette/blend/enum.Equation.html
Normal file
91
cosmic/cosmic_theme/palette/blend/enum.Equation.html
Normal file
File diff suppressed because one or more lines are too long
97
cosmic/cosmic_theme/palette/blend/enum.Parameter.html
Normal file
97
cosmic/cosmic_theme/palette/blend/enum.Parameter.html
Normal file
File diff suppressed because one or more lines are too long
30
cosmic/cosmic_theme/palette/blend/index.html
Normal file
30
cosmic/cosmic_theme/palette/blend/index.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<!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="Color blending and blending equations."><title>cosmic::cosmic_theme::palette::blend - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../static.files/storage-68b7e25d.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module blend</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In cosmic::<wbr>cosmic_<wbr>theme::<wbr>palette</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">cosmic</a>::<wbr><a href="../../index.html">cosmic_theme</a>::<wbr><a href="../index.html">palette</a></div><h1>Module <span>blend</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="https://docs.rs/palette/0.7.6/src/palette/lib.rs.html#345">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Color blending and blending equations.</p>
|
||||
<p>Palette offers both OpenGL style blending equations, as well as most of the
|
||||
SVG composition operators (also common in photo manipulation software). The
|
||||
composition operators are all implemented in the <a href="trait.Compose.html" title="trait cosmic::cosmic_theme::palette::blend::Compose"><code>Compose</code></a> and <a href="trait.Blend.html" title="trait cosmic::cosmic_theme::palette::blend::Blend"><code>Blend</code></a>
|
||||
traits, and ready to use with any appropriate color type:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>palette::{blend::Blend, LinSrgba};
|
||||
|
||||
<span class="kw">let </span>a = LinSrgba::new(<span class="number">0.2</span>, <span class="number">0.5</span>, <span class="number">0.1</span>, <span class="number">0.8</span>);
|
||||
<span class="kw">let </span>b = LinSrgba::new(<span class="number">0.6</span>, <span class="number">0.3</span>, <span class="number">0.5</span>, <span class="number">0.1</span>);
|
||||
<span class="kw">let </span>c = a.overlay(b);</code></pre></div>
|
||||
<p>Blending equations can be defined using the <a href="struct.Equations.html" title="struct cosmic::cosmic_theme::palette::blend::Equations"><code>Equations</code></a> type, which is
|
||||
then passed to the <code>blend</code> function, from the <code>Blend</code> trait:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>palette::LinSrgba;
|
||||
<span class="kw">use </span>palette::blend::{BlendWith, Equations, Parameter};
|
||||
|
||||
<span class="kw">let </span>blend_mode = Equations::from_parameters(
|
||||
Parameter::SourceAlpha,
|
||||
Parameter::OneMinusSourceAlpha
|
||||
);
|
||||
|
||||
<span class="kw">let </span>a = LinSrgba::new(<span class="number">0.2</span>, <span class="number">0.5</span>, <span class="number">0.1</span>, <span class="number">0.8</span>);
|
||||
<span class="kw">let </span>b = LinSrgba::new(<span class="number">0.6</span>, <span class="number">0.3</span>, <span class="number">0.5</span>, <span class="number">0.1</span>);
|
||||
<span class="kw">let </span>c = a.blend_with(b, blend_mode);</code></pre></div>
|
||||
<p>Note that blending will use <a href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">premultiplied alpha</a>,
|
||||
which may result in loss of some color information in some cases. One such
|
||||
case is that a completely transparent resultant color will become black.</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Equations.html" title="struct cosmic::cosmic_theme::palette::blend::Equations">Equations</a></dt><dd>A pair of blending equations and corresponding parameters.</dd><dt><a class="struct" href="struct.Parameters.html" title="struct cosmic::cosmic_theme::palette::blend::Parameters">Parameters</a></dt><dd>A pair of source and destination parameters.</dd><dt><a class="struct" href="struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::blend::PreAlpha">PreAlpha</a></dt><dd>Premultiplied alpha wrapper.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Equation.html" title="enum cosmic::cosmic_theme::palette::blend::Equation">Equation</a></dt><dd>A blending equation.</dd><dt><a class="enum" href="enum.Parameter.html" title="enum cosmic::cosmic_theme::palette::blend::Parameter">Parameter</a></dt><dd>A blending parameter.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Blend.html" title="trait cosmic::cosmic_theme::palette::blend::Blend">Blend</a></dt><dd>A trait for different ways of mixing colors together.</dd><dt><a class="trait" href="trait.BlendFunction.html" title="trait cosmic::cosmic_theme::palette::blend::BlendFunction">Blend<wbr>Function</a></dt><dd>A trait for custom blend functions.</dd><dt><a class="trait" href="trait.BlendWith.html" title="trait cosmic::cosmic_theme::palette::blend::BlendWith">Blend<wbr>With</a></dt><dd>Blending with a custom blend function.</dd><dt><a class="trait" href="trait.Compose.html" title="trait cosmic::cosmic_theme::palette::blend::Compose">Compose</a></dt><dd>The Porter Duff composition operators, <a href="https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators">as described by
|
||||
W3C</a>.</dd><dt><a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a></dt><dd>Alpha masking and unmasking.</dd></dl></section></div></main></body></html>
|
||||
1
cosmic/cosmic_theme/palette/blend/sidebar-items.js
Normal file
1
cosmic/cosmic_theme/palette/blend/sidebar-items.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
window.SIDEBAR_ITEMS = {"enum":["Equation","Parameter"],"struct":["Equations","Parameters","PreAlpha"],"trait":["Blend","BlendFunction","BlendWith","Compose","Premultiply"]};
|
||||
96
cosmic/cosmic_theme/palette/blend/struct.Equations.html
Normal file
96
cosmic/cosmic_theme/palette/blend/struct.Equations.html
Normal file
File diff suppressed because one or more lines are too long
81
cosmic/cosmic_theme/palette/blend/struct.Parameters.html
Normal file
81
cosmic/cosmic_theme/palette/blend/struct.Parameters.html
Normal file
File diff suppressed because one or more lines are too long
343
cosmic/cosmic_theme/palette/blend/struct.PreAlpha.html
Normal file
343
cosmic/cosmic_theme/palette/blend/struct.PreAlpha.html
Normal file
File diff suppressed because one or more lines are too long
51
cosmic/cosmic_theme/palette/blend/trait.Blend.html
Normal file
51
cosmic/cosmic_theme/palette/blend/trait.Blend.html
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<!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 for different ways of mixing colors together."><title>Blend in cosmic::cosmic_theme::palette::blend - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Blend</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.burn" title="burn">burn</a></li><li><a href="#tymethod.darken" title="darken">darken</a></li><li><a href="#tymethod.difference" title="difference">difference</a></li><li><a href="#tymethod.dodge" title="dodge">dodge</a></li><li><a href="#tymethod.exclusion" title="exclusion">exclusion</a></li><li><a href="#tymethod.hard_light" title="hard_light">hard_light</a></li><li><a href="#tymethod.lighten" title="lighten">lighten</a></li><li><a href="#tymethod.multiply" title="multiply">multiply</a></li><li><a href="#tymethod.overlay" title="overlay">overlay</a></li><li><a href="#tymethod.screen" title="screen">screen</a></li><li><a href="#tymethod.soft_light" title="soft_light">soft_light</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cosmic_<wbr>theme::<wbr>palette::<wbr>blend</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">cosmic</a>::<wbr><a href="../../index.html">cosmic_theme</a>::<wbr><a href="../index.html">palette</a>::<wbr><a href="index.html">blend</a></div><h1>Trait <span class="trait">Blend</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#19">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Blend {
|
||||
// Required methods
|
||||
fn <a href="#tymethod.multiply" class="fn">multiply</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.screen" class="fn">screen</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.overlay" class="fn">overlay</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.darken" class="fn">darken</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.lighten" class="fn">lighten</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.dodge" class="fn">dodge</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.burn" class="fn">burn</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.hard_light" class="fn">hard_light</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.soft_light" class="fn">soft_light</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.difference" class="fn">difference</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.exclusion" class="fn">exclusion</a>(self, other: Self) -> Self;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A trait for different ways of mixing colors together.</p>
|
||||
<p>This implements the classic separable blend modes, <a href="https://www.w3.org/TR/compositing-1/#blending">as described by
|
||||
W3C</a>.</p>
|
||||
<p><em>Note: The default implementations of the blend modes are meant for color
|
||||
components in the range [0.0, 1.0] and may otherwise produce strange
|
||||
results.</em></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.multiply" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#23">Source</a><h4 class="code-header">fn <a href="#tymethod.multiply" class="fn">multiply</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Multiply <code>self</code> with <code>other</code>. This uses the alpha component to regulate
|
||||
the effect, so it’s not just plain component wise multiplication.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.screen" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#27">Source</a><h4 class="code-header">fn <a href="#tymethod.screen" class="fn">screen</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Make a color which is at least as light as <code>self</code> or <code>other</code>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.overlay" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#32">Source</a><h4 class="code-header">fn <a href="#tymethod.overlay" class="fn">overlay</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Multiply <code>self</code> or <code>other</code> if other is dark, or screen them if <code>other</code>
|
||||
is light. This results in an S curve.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.darken" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#36">Source</a><h4 class="code-header">fn <a href="#tymethod.darken" class="fn">darken</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Return the darkest parts of <code>self</code> and <code>other</code>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.lighten" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#40">Source</a><h4 class="code-header">fn <a href="#tymethod.lighten" class="fn">lighten</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Return the lightest parts of <code>self</code> and <code>other</code>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.dodge" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#45">Source</a><h4 class="code-header">fn <a href="#tymethod.dodge" class="fn">dodge</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Lighten <code>other</code> to reflect <code>self</code>. Results in <code>other</code> if <code>self</code> is
|
||||
black.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.burn" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#50">Source</a><h4 class="code-header">fn <a href="#tymethod.burn" class="fn">burn</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Darken <code>other</code> to reflect <code>self</code>. Results in <code>other</code> if <code>self</code> is
|
||||
white.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.hard_light" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#56">Source</a><h4 class="code-header">fn <a href="#tymethod.hard_light" class="fn">hard_light</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Multiply <code>self</code> or <code>other</code> if other is dark, or screen them if <code>self</code>
|
||||
is light. This is similar to <code>overlay</code>, but depends on <code>self</code> instead
|
||||
of <code>other</code>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.soft_light" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#62">Source</a><h4 class="code-header">fn <a href="#tymethod.soft_light" class="fn">soft_light</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Lighten <code>other</code> if <code>self</code> is light, or darken <code>other</code> as if it’s burned
|
||||
if <code>self</code> is dark. The effect is increased if the components of <code>self</code>
|
||||
is further from 0.5.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.difference" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#67">Source</a><h4 class="code-header">fn <a href="#tymethod.difference" class="fn">difference</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Return the absolute difference between <code>self</code> and <code>other</code>. It’s
|
||||
basically <code>abs(self - other)</code>, but regulated by the alpha component.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.exclusion" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#73">Source</a><h4 class="code-header">fn <a href="#tymethod.exclusion" class="fn">exclusion</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Similar to <code>difference</code>, but appears to result in a lower contrast.
|
||||
<code>other</code> is inverted if <code>self</code> is white, and preserved if <code>self</code> is
|
||||
black.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Blend-for-PreAlpha%3CC%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#76-80">Source</a><a href="#impl-Blend-for-PreAlpha%3CC%3E" class="anchor">§</a><h3 class="code-header">impl<C, T, const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <a class="trait" href="trait.Blend.html" title="trait cosmic::cosmic_theme::palette::blend::Blend">Blend</a> for <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C><div class="where">where
|
||||
C: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a><Scalar = T> + <a class="trait" href="../stimulus/trait.StimulusColor.html" title="trait cosmic::cosmic_theme::palette::stimulus::StimulusColor">StimulusColor</a> + <a class="trait" href="../cast/trait.ArrayCast.html" title="trait cosmic::cosmic_theme::palette::cast::ArrayCast">ArrayCast</a><Array = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
T: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.One.html" title="trait cosmic::cosmic_theme::palette::num::One">One</a> + <a class="trait" href="../num/trait.MinMax.html" title="trait cosmic::cosmic_theme::palette::num::MinMax">MinMax</a> + <a class="trait" href="../num/trait.Clamp.html" title="trait cosmic::cosmic_theme::palette::num::Clamp">Clamp</a> + <a class="trait" href="../num/trait.Sqrt.html" title="trait cosmic::cosmic_theme::palette::num::Sqrt">Sqrt</a> + <a class="trait" href="../num/trait.Abs.html" title="trait cosmic::cosmic_theme::palette::num::Abs">Abs</a> + <a class="trait" href="../num/trait.Arithmetics.html" title="trait cosmic::cosmic_theme::palette::num::Arithmetics">Arithmetics</a> + <a class="trait" href="../num/trait.PartialCmp.html" title="trait cosmic::cosmic_theme::palette::num::PartialCmp">PartialCmp</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<T as <a class="trait" href="../bool_mask/trait.HasBoolMask.html" title="trait cosmic::cosmic_theme::palette::bool_mask::HasBoolMask">HasBoolMask</a>>::<a class="associatedtype" href="../bool_mask/trait.HasBoolMask.html#associatedtype.Mask" title="type cosmic::cosmic_theme::palette::bool_mask::HasBoolMask::Mask">Mask</a>: <a class="trait" href="../bool_mask/trait.LazySelect.html" title="trait cosmic::cosmic_theme::palette::bool_mask::LazySelect">LazySelect</a><T>,</div></h3></section><section id="impl-Blend-for-Alpha%3CC,+T%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#229-233">Source</a><a href="#impl-Blend-for-Alpha%3CC,+T%3E" class="anchor">§</a><h3 class="code-header">impl<C, T, const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <a class="trait" href="trait.Blend.html" title="trait cosmic::cosmic_theme::palette::blend::Blend">Blend</a> for <a class="struct" href="../struct.Alpha.html" title="struct cosmic::cosmic_theme::palette::Alpha">Alpha</a><C, T><div class="where">where
|
||||
C: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a><Scalar = T> + <a class="trait" href="../stimulus/trait.StimulusColor.html" title="trait cosmic::cosmic_theme::palette::stimulus::StimulusColor">StimulusColor</a> + <a class="trait" href="../cast/trait.ArrayCast.html" title="trait cosmic::cosmic_theme::palette::cast::ArrayCast">ArrayCast</a><Array = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
T: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.One.html" title="trait cosmic::cosmic_theme::palette::num::One">One</a> + <a class="trait" href="../num/trait.MinMax.html" title="trait cosmic::cosmic_theme::palette::num::MinMax">MinMax</a> + <a class="trait" href="../num/trait.Clamp.html" title="trait cosmic::cosmic_theme::palette::num::Clamp">Clamp</a> + <a class="trait" href="../num/trait.Sqrt.html" title="trait cosmic::cosmic_theme::palette::num::Sqrt">Sqrt</a> + <a class="trait" href="../num/trait.Abs.html" title="trait cosmic::cosmic_theme::palette::num::Abs">Abs</a> + <a class="trait" href="../num/trait.Arithmetics.html" title="trait cosmic::cosmic_theme::palette::num::Arithmetics">Arithmetics</a> + <a class="trait" href="../num/trait.PartialCmp.html" title="trait cosmic::cosmic_theme::palette::num::PartialCmp">PartialCmp</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<T as <a class="trait" href="../bool_mask/trait.HasBoolMask.html" title="trait cosmic::cosmic_theme::palette::bool_mask::HasBoolMask">HasBoolMask</a>>::<a class="associatedtype" href="../bool_mask/trait.HasBoolMask.html#associatedtype.Mask" title="type cosmic::cosmic_theme::palette::bool_mask::HasBoolMask::Mask">Mask</a>: <a class="trait" href="../bool_mask/trait.LazySelect.html" title="trait cosmic::cosmic_theme::palette::bool_mask::LazySelect">LazySelect</a><T>,</div></h3></section><section id="impl-Blend-for-C" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend.rs.html#138-142">Source</a><a href="#impl-Blend-for-C" class="anchor">§</a><h3 class="code-header">impl<C, T, const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <a class="trait" href="trait.Blend.html" title="trait cosmic::cosmic_theme::palette::blend::Blend">Blend</a> for C<div class="where">where
|
||||
C: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a><Scalar = T> + <a class="trait" href="../stimulus/trait.StimulusColor.html" title="trait cosmic::cosmic_theme::palette::stimulus::StimulusColor">StimulusColor</a> + <a class="trait" href="../cast/trait.ArrayCast.html" title="trait cosmic::cosmic_theme::palette::cast::ArrayCast">ArrayCast</a><Array = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
T: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.One.html" title="trait cosmic::cosmic_theme::palette::num::One">One</a> + <a class="trait" href="../num/trait.MinMax.html" title="trait cosmic::cosmic_theme::palette::num::MinMax">MinMax</a> + <a class="trait" href="../num/trait.Clamp.html" title="trait cosmic::cosmic_theme::palette::num::Clamp">Clamp</a> + <a class="trait" href="../num/trait.Sqrt.html" title="trait cosmic::cosmic_theme::palette::num::Sqrt">Sqrt</a> + <a class="trait" href="../num/trait.Abs.html" title="trait cosmic::cosmic_theme::palette::num::Abs">Abs</a> + <a class="trait" href="../num/trait.Arithmetics.html" title="trait cosmic::cosmic_theme::palette::num::Arithmetics">Arithmetics</a> + <a class="trait" href="../num/trait.PartialCmp.html" title="trait cosmic::cosmic_theme::palette::num::PartialCmp">PartialCmp</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<T as <a class="trait" href="../bool_mask/trait.HasBoolMask.html" title="trait cosmic::cosmic_theme::palette::bool_mask::HasBoolMask">HasBoolMask</a>>::<a class="associatedtype" href="../bool_mask/trait.HasBoolMask.html#associatedtype.Mask" title="type cosmic::cosmic_theme::palette::bool_mask::HasBoolMask::Mask">Mask</a>: <a class="trait" href="../bool_mask/trait.LazySelect.html" title="trait cosmic::cosmic_theme::palette::bool_mask::LazySelect">LazySelect</a><T>,</div></h3></section></div><script src="../../../../trait.impl/palette/blend/blend/trait.Blend.js" data-ignore-extern-crates="palette" async></script></section></div></main></body></html>
|
||||
16
cosmic/cosmic_theme/palette/blend/trait.BlendFunction.html
Normal file
16
cosmic/cosmic_theme/palette/blend/trait.BlendFunction.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!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 for custom blend functions."><title>BlendFunction in cosmic::cosmic_theme::palette::blend - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Blend<wbr>Function</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.apply_to" title="apply_to">apply_to</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cosmic_<wbr>theme::<wbr>palette::<wbr>blend</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">cosmic</a>::<wbr><a href="../../index.html">cosmic_theme</a>::<wbr><a href="../index.html">palette</a>::<wbr><a href="index.html">blend</a></div><h1>Trait <span class="trait">BlendFunction</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="https://docs.rs/palette/0.7.6/src/palette/blend.rs.html#63">Source</a> </span></div><pre class="rust item-decl"><code>pub trait BlendFunction<C><div class="where">where
|
||||
C: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>,</div>{
|
||||
// Required method
|
||||
fn <a href="#tymethod.apply_to" class="fn">apply_to</a>(
|
||||
self,
|
||||
source: <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C>,
|
||||
destination: <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C>,
|
||||
) -> <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A trait for custom blend functions.</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.apply_to" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend.rs.html#69">Source</a><h4 class="code-header">fn <a href="#tymethod.apply_to" class="fn">apply_to</a>(self, source: <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C>, destination: <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C>) -> <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C></h4></section></summary><div class="docblock"><p>Apply this blend function to a pair of colors.</p>
|
||||
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-BlendFunction%3CC%3E-for-F" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend.rs.html#72-75">Source</a><a href="#impl-BlendFunction%3CC%3E-for-F" class="anchor">§</a><h3 class="code-header">impl<C, F> <a class="trait" href="trait.BlendFunction.html" title="trait cosmic::cosmic_theme::palette::blend::BlendFunction">BlendFunction</a><C> for F<div class="where">where
|
||||
C: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>,
|
||||
F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C>, <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C>) -> <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C>,</div></h3></section><section id="impl-BlendFunction%3CC%3E-for-Equations" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/equations.rs.html#68-76">Source</a><a href="#impl-BlendFunction%3CC%3E-for-Equations" class="anchor">§</a><h3 class="code-header">impl<C, S, const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, const M: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <a class="trait" href="trait.BlendFunction.html" title="trait cosmic::cosmic_theme::palette::blend::BlendFunction">BlendFunction</a><C> for <a class="struct" href="struct.Equations.html" title="struct cosmic::cosmic_theme::palette::blend::Equations">Equations</a><div class="where">where
|
||||
C: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a><Scalar = S> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a><Output = C, Output = C> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a><S> + <a class="trait" href="../cast/trait.ArrayCast.html" title="trait cosmic::cosmic_theme::palette::cast::ArrayCast">ArrayCast</a><Array = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[S; N]</a>> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C>: <a class="trait" href="../cast/trait.ArrayCast.html" title="trait cosmic::cosmic_theme::palette::cast::ArrayCast">ArrayCast</a><Array = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[S; M]</a>>,
|
||||
S: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../num/trait.One.html" title="trait cosmic::cosmic_theme::palette::num::One">One</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.MinMax.html" title="trait cosmic::cosmic_theme::palette::num::MinMax">MinMax</a> + <a class="trait" href="../num/trait.Sqrt.html" title="trait cosmic::cosmic_theme::palette::num::Sqrt">Sqrt</a> + <a class="trait" href="../num/trait.IsValidDivisor.html" title="trait cosmic::cosmic_theme::palette::num::IsValidDivisor">IsValidDivisor</a> + <a class="trait" href="../num/trait.Arithmetics.html" title="trait cosmic::cosmic_theme::palette::num::Arithmetics">Arithmetics</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></div><script src="../../../../trait.impl/palette/blend/trait.BlendFunction.js" data-ignore-extern-crates="palette" async></script></section></div></main></body></html>
|
||||
37
cosmic/cosmic_theme/palette/blend/trait.BlendWith.html
Normal file
37
cosmic/cosmic_theme/palette/blend/trait.BlendWith.html
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<!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="Blending with a custom blend function."><title>BlendWith in cosmic::cosmic_theme::palette::blend - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Blend<wbr>With</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Color" title="Color">Color</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.blend_with" title="blend_with">blend_with</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cosmic_<wbr>theme::<wbr>palette::<wbr>blend</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">cosmic</a>::<wbr><a href="../../index.html">cosmic_theme</a>::<wbr><a href="../index.html">palette</a>::<wbr><a href="index.html">blend</a></div><h1>Trait <span class="trait">BlendWith</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend_with.rs.html#11">Source</a> </span></div><pre class="rust item-decl"><code>pub trait BlendWith {
|
||||
type <a href="#associatedtype.Color" class="associatedtype">Color</a>: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>;
|
||||
|
||||
// Required method
|
||||
fn <a href="#tymethod.blend_with" class="fn">blend_with</a><F>(self, destination: Self, blend_function: F) -> Self
|
||||
<span class="where">where F: <a class="trait" href="trait.BlendFunction.html" title="trait cosmic::cosmic_theme::palette::blend::BlendFunction">BlendFunction</a><Self::<a class="associatedtype" href="trait.BlendWith.html#associatedtype.Color" title="type cosmic::cosmic_theme::palette::blend::BlendWith::Color">Color</a>></span>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Blending with a custom blend function.</p>
|
||||
<p>This is a convenience trait that makes it possible to use <a href="trait.BlendFunction.html" title="trait cosmic::cosmic_theme::palette::blend::BlendFunction"><code>BlendFunction</code></a>
|
||||
via a method on the source color. This makes custom blending more similar to
|
||||
how the <a href="trait.Compose.html" title="trait cosmic::cosmic_theme::palette::blend::Compose"><code>Compose</code></a> and <a href="trait.Blend.html" title="trait cosmic::cosmic_theme::palette::blend::Blend"><code>Blend</code></a> are used,
|
||||
including automatic pre-multiplication.</p>
|
||||
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Color" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend_with.rs.html#13">Source</a><h4 class="code-header">type <a href="#associatedtype.Color" class="associatedtype">Color</a>: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a></h4></section></summary><div class="docblock"><p>The base color type of <code>Self</code>.</p>
|
||||
</div></details></div><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.blend_with" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend_with.rs.html#37-39">Source</a><h4 class="code-header">fn <a href="#tymethod.blend_with" class="fn">blend_with</a><F>(self, destination: Self, blend_function: F) -> Self<div class="where">where
|
||||
F: <a class="trait" href="trait.BlendFunction.html" title="trait cosmic::cosmic_theme::palette::blend::BlendFunction">BlendFunction</a><Self::<a class="associatedtype" href="trait.BlendWith.html#associatedtype.Color" title="type cosmic::cosmic_theme::palette::blend::BlendWith::Color">Color</a>>,</div></h4></section></summary><div class="docblock"><p>Blend self, as the source color, with <code>destination</code>, using
|
||||
<code>blend_function</code>. Anything that implements <a href="trait.BlendFunction.html" title="trait cosmic::cosmic_theme::palette::blend::BlendFunction"><code>BlendFunction</code></a> is
|
||||
acceptable, including functions and closures.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>palette::{LinSrgb, LinSrgba};
|
||||
<span class="kw">use </span>palette::blend::{BlendWith, PreAlpha};
|
||||
|
||||
<span class="kw">type </span>PreRgba = PreAlpha<LinSrgb<f32>>;
|
||||
|
||||
<span class="kw">fn </span>blend_mode(a: PreRgba, b: PreRgba) -> PreRgba {
|
||||
PreAlpha {
|
||||
color: LinSrgb::new(a.red * b.green, a.green * b.blue, a.blue * b.red),
|
||||
alpha: a.alpha * b.alpha,
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">let </span>a = LinSrgba::new(<span class="number">0.2</span>, <span class="number">0.5</span>, <span class="number">0.1</span>, <span class="number">0.8</span>);
|
||||
<span class="kw">let </span>b = LinSrgba::new(<span class="number">0.6</span>, <span class="number">0.3</span>, <span class="number">0.5</span>, <span class="number">0.1</span>);
|
||||
<span class="kw">let </span>c = a.blend_with(b, blend_mode);</code></pre></div>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-BlendWith-for-PreAlpha%3CC%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend_with.rs.html#42-44">Source</a><a href="#impl-BlendWith-for-PreAlpha%3CC%3E" class="anchor">§</a><h3 class="code-header">impl<C> <a class="trait" href="trait.BlendWith.html" title="trait cosmic::cosmic_theme::palette::blend::BlendWith">BlendWith</a> for <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C><div class="where">where
|
||||
C: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Color-1" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend_with.rs.html#46">Source</a><a href="#associatedtype.Color-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Color" class="associatedtype">Color</a> = C</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BlendWith-for-Alpha%3CC,+%3CC+as+Premultiply%3E::Scalar%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend_with.rs.html#57-59">Source</a><a href="#impl-BlendWith-for-Alpha%3CC,+%3CC+as+Premultiply%3E::Scalar%3E" class="anchor">§</a><h3 class="code-header">impl<C> <a class="trait" href="trait.BlendWith.html" title="trait cosmic::cosmic_theme::palette::blend::BlendWith">BlendWith</a> for <a class="struct" href="../struct.Alpha.html" title="struct cosmic::cosmic_theme::palette::Alpha">Alpha</a><C, <C as <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>>::<a class="associatedtype" href="trait.Premultiply.html#associatedtype.Scalar" title="type cosmic::cosmic_theme::palette::blend::Premultiply::Scalar">Scalar</a>><div class="where">where
|
||||
C: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Color-2" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend_with.rs.html#61">Source</a><a href="#associatedtype.Color-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Color" class="associatedtype">Color</a> = C</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-BlendWith-for-C" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend_with.rs.html#73-76">Source</a><a href="#impl-BlendWith-for-C" class="anchor">§</a><h3 class="code-header">impl<C> <a class="trait" href="trait.BlendWith.html" title="trait cosmic::cosmic_theme::palette::blend::BlendWith">BlendWith</a> for C<div class="where">where
|
||||
C: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>,
|
||||
<C as <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>>::<a class="associatedtype" href="trait.Premultiply.html#associatedtype.Scalar" title="type cosmic::cosmic_theme::palette::blend::Premultiply::Scalar">Scalar</a>: <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Color-3" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/blend_with.rs.html#78">Source</a><a href="#associatedtype.Color-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Color" class="associatedtype">Color</a> = C</h4></section></div></details></div><script src="../../../../trait.impl/palette/blend/blend_with/trait.BlendWith.js" data-ignore-extern-crates="palette" async></script></section></div></main></body></html>
|
||||
31
cosmic/cosmic_theme/palette/blend/trait.Compose.html
Normal file
31
cosmic/cosmic_theme/palette/blend/trait.Compose.html
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<!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="The Porter Duff composition operators, as described by W3C."><title>Compose in cosmic::cosmic_theme::palette::blend - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Compose</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.atop" title="atop">atop</a></li><li><a href="#tymethod.inside" title="inside">inside</a></li><li><a href="#tymethod.outside" title="outside">outside</a></li><li><a href="#tymethod.over" title="over">over</a></li><li><a href="#tymethod.plus" title="plus">plus</a></li><li><a href="#tymethod.xor" title="xor">xor</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cosmic_<wbr>theme::<wbr>palette::<wbr>blend</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">cosmic</a>::<wbr><a href="../../index.html">cosmic_theme</a>::<wbr><a href="../index.html">palette</a>::<wbr><a href="index.html">blend</a></div><h1>Trait <span class="trait">Compose</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="https://docs.rs/palette/0.7.6/src/palette/blend/compose.rs.html#17">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Compose {
|
||||
// Required methods
|
||||
fn <a href="#tymethod.over" class="fn">over</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.inside" class="fn">inside</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.outside" class="fn">outside</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.atop" class="fn">atop</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.xor" class="fn">xor</a>(self, other: Self) -> Self;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.plus" class="fn">plus</a>(self, other: Self) -> Self;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The Porter Duff composition operators, <a href="https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators">as described by
|
||||
W3C</a>.</p>
|
||||
<p>This set of operators exclude the variants where source and destination are
|
||||
swapped, as well as the “clear”, “copy” and “destination” operators. Those
|
||||
can easily be achieved using other means.</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.over" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/compose.rs.html#21">Source</a><h4 class="code-header">fn <a href="#tymethod.over" class="fn">over</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Place <code>self</code> over <code>other</code>. This is the good old common alpha composition
|
||||
equation.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.inside" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/compose.rs.html#26">Source</a><h4 class="code-header">fn <a href="#tymethod.inside" class="fn">inside</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Results in the parts of <code>self</code> that overlaps the visible parts of
|
||||
<code>other</code>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.outside" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/compose.rs.html#31">Source</a><h4 class="code-header">fn <a href="#tymethod.outside" class="fn">outside</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Results in the parts of <code>self</code> that lies outside the visible parts of
|
||||
<code>other</code>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.atop" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/compose.rs.html#35">Source</a><h4 class="code-header">fn <a href="#tymethod.atop" class="fn">atop</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Place <code>self</code> over only the visible parts of <code>other</code>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.xor" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/compose.rs.html#39">Source</a><h4 class="code-header">fn <a href="#tymethod.xor" class="fn">xor</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Results in either <code>self</code> or <code>other</code>, where they do not overlap.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.plus" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/compose.rs.html#44">Source</a><h4 class="code-header">fn <a href="#tymethod.plus" class="fn">plus</a>(self, other: Self) -> Self</h4></section></summary><div class="docblock"><p>Add <code>self</code> and <code>other</code>. This uses the alpha component to regulate the
|
||||
effect, so it’s not just plain component wise addition.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Compose-for-Alpha%3CC,+%3CC+as+Premultiply%3E::Scalar%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/compose.rs.html#125-128">Source</a><a href="#impl-Compose-for-Alpha%3CC,+%3CC+as+Premultiply%3E::Scalar%3E" class="anchor">§</a><h3 class="code-header">impl<C> <a class="trait" href="trait.Compose.html" title="trait cosmic::cosmic_theme::palette::blend::Compose">Compose</a> for <a class="struct" href="../struct.Alpha.html" title="struct cosmic::cosmic_theme::palette::Alpha">Alpha</a><C, <C as <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>>::<a class="associatedtype" href="trait.Premultiply.html#associatedtype.Scalar" title="type cosmic::cosmic_theme::palette::blend::Premultiply::Scalar">Scalar</a>><div class="where">where
|
||||
C: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>,
|
||||
<a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C>: <a class="trait" href="trait.Compose.html" title="trait cosmic::cosmic_theme::palette::blend::Compose">Compose</a>,</div></h3></section><section id="impl-Compose-for-C" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/compose.rs.html#165-169">Source</a><a href="#impl-Compose-for-C" class="anchor">§</a><h3 class="code-header">impl<C> <a class="trait" href="trait.Compose.html" title="trait cosmic::cosmic_theme::palette::blend::Compose">Compose</a> for C<div class="where">where
|
||||
C: <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>,
|
||||
<C as <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a>>::<a class="associatedtype" href="trait.Premultiply.html#associatedtype.Scalar" title="type cosmic::cosmic_theme::palette::blend::Premultiply::Scalar">Scalar</a>: <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a>,
|
||||
<a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C>: <a class="trait" href="trait.Compose.html" title="trait cosmic::cosmic_theme::palette::blend::Compose">Compose</a>,</div></h3></section><section id="impl-Compose-for-PreAlpha%3CC%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend/compose.rs.html#47-50">Source</a><a href="#impl-Compose-for-PreAlpha%3CC%3E" class="anchor">§</a><h3 class="code-header">impl<C, T, const N: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>> <a class="trait" href="trait.Compose.html" title="trait cosmic::cosmic_theme::palette::blend::Compose">Compose</a> for <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><C><div class="where">where
|
||||
C: <a class="trait" href="../cast/trait.ArrayCast.html" title="trait cosmic::cosmic_theme::palette::cast::ArrayCast">ArrayCast</a><Array = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[T; N]</a>> + <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a><Scalar = T>,
|
||||
T: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.One.html" title="trait cosmic::cosmic_theme::palette::num::One">One</a> + <a class="trait" href="../num/trait.Arithmetics.html" title="trait cosmic::cosmic_theme::palette::num::Arithmetics">Arithmetics</a> + <a class="trait" href="../num/trait.Clamp.html" title="trait cosmic::cosmic_theme::palette::num::Clamp">Clamp</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></div><script src="../../../../trait.impl/palette/blend/compose/trait.Compose.js" data-ignore-extern-crates="palette" async></script></section></div></main></body></html>
|
||||
30
cosmic/cosmic_theme/palette/blend/trait.Premultiply.html
Normal file
30
cosmic/cosmic_theme/palette/blend/trait.Premultiply.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<!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="Alpha masking and unmasking."><title>Premultiply in cosmic::cosmic_theme::palette::blend - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.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-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-aa0817cf.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="cosmic" data-themes="" data-resource-suffix="" data-rustdoc-version="1.90.0-nightly (3048886e5 2025-07-30)" data-channel="nightly" data-search-js="search-fa3e91e5.js" data-settings-js="settings-5514c975.js" ><script src="../../../../static.files/storage-68b7e25d.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-eebb9057.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../../../static.files/favicon-044be391.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></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../cosmic/index.html">cosmic</a><span class="version">1.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Premultiply</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Scalar" title="Scalar">Scalar</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.premultiply" title="premultiply">premultiply</a></li><li><a href="#tymethod.unpremultiply" title="unpremultiply">unpremultiply</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In cosmic::<wbr>cosmic_<wbr>theme::<wbr>palette::<wbr>blend</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">cosmic</a>::<wbr><a href="../../index.html">cosmic_theme</a>::<wbr><a href="../index.html">palette</a>::<wbr><a href="index.html">blend</a></div><h1>Trait <span class="trait">Premultiply</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="https://docs.rs/palette/0.7.6/src/palette/blend.rs.html#84">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Premultiply: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
|
||||
type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a>: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a>;
|
||||
|
||||
// Required methods
|
||||
fn <a href="#tymethod.premultiply" class="fn">premultiply</a>(self, alpha: Self::<a class="associatedtype" href="trait.Premultiply.html#associatedtype.Scalar" title="type cosmic::cosmic_theme::palette::blend::Premultiply::Scalar">Scalar</a>) -> <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><Self>;
|
||||
<span class="item-spacer"></span> fn <a href="#tymethod.unpremultiply" class="fn">unpremultiply</a>(premultiplied: <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><Self>) -> (Self, Self::<a class="associatedtype" href="trait.Premultiply.html#associatedtype.Scalar" title="type cosmic::cosmic_theme::palette::blend::Premultiply::Scalar">Scalar</a>);
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Alpha masking and unmasking.</p>
|
||||
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Scalar" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend.rs.html#86">Source</a><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a>: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a></h4></section></summary><div class="docblock"><p>The color’s component type.</p>
|
||||
</div></details></div><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.premultiply" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend.rs.html#92">Source</a><h4 class="code-header">fn <a href="#tymethod.premultiply" class="fn">premultiply</a>(self, alpha: Self::<a class="associatedtype" href="trait.Premultiply.html#associatedtype.Scalar" title="type cosmic::cosmic_theme::palette::blend::Premultiply::Scalar">Scalar</a>) -> <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><Self></h4></section></summary><div class="docblock"><p>Alpha mask the color.</p>
|
||||
<p>This is done by multiplying the color’s component by <code>alpha</code>.</p>
|
||||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.unpremultiply" class="method"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/blend.rs.html#99">Source</a><h4 class="code-header">fn <a href="#tymethod.unpremultiply" class="fn">unpremultiply</a>(premultiplied: <a class="struct" href="../alpha/struct.PreAlpha.html" title="struct cosmic::cosmic_theme::palette::alpha::PreAlpha">PreAlpha</a><Self>) -> (Self, Self::<a class="associatedtype" href="trait.Premultiply.html#associatedtype.Scalar" title="type cosmic::cosmic_theme::palette::blend::Premultiply::Scalar">Scalar</a>)</h4></section></summary><div class="docblock"><p>Alpha unmask the color, resulting in a color and transparency pair.</p>
|
||||
<p>This is done by dividing the masked color’s component by <code>alpha</code>, or
|
||||
returning a black color if <code>alpha</code> is <code>0</code>.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-Premultiply-for-Luma%3CS,+T%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/luma/luma.rs.html#576">Source</a><a href="#impl-Premultiply-for-Luma%3CS,+T%3E" class="anchor">§</a><h3 class="code-header">impl<S, T> <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a> for <a class="struct" href="../luma/struct.Luma.html" title="struct cosmic::cosmic_theme::palette::luma::Luma">Luma</a><S, T><div class="where">where
|
||||
T: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.IsValidDivisor.html" title="trait cosmic::cosmic_theme::palette::num::IsValidDivisor">IsValidDivisor</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<T as <a class="trait" href="../bool_mask/trait.HasBoolMask.html" title="trait cosmic::cosmic_theme::palette::bool_mask::HasBoolMask">HasBoolMask</a>>::<a class="associatedtype" href="../bool_mask/trait.HasBoolMask.html#associatedtype.Mask" title="type cosmic::cosmic_theme::palette::bool_mask::HasBoolMask::Mask">Mask</a>: <a class="trait" href="../bool_mask/trait.LazySelect.html" title="trait cosmic::cosmic_theme::palette::bool_mask::LazySelect">LazySelect</a><T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Scalar-1" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/luma/luma.rs.html#576">Source</a><a href="#associatedtype.Scalar-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a> = T</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Premultiply-for-Rgb%3CS,+T%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/rgb/rgb.rs.html#973">Source</a><a href="#impl-Premultiply-for-Rgb%3CS,+T%3E" class="anchor">§</a><h3 class="code-header">impl<S, T> <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a> for <a class="struct" href="../rgb/struct.Rgb.html" title="struct cosmic::cosmic_theme::palette::rgb::Rgb">Rgb</a><S, T><div class="where">where
|
||||
T: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.IsValidDivisor.html" title="trait cosmic::cosmic_theme::palette::num::IsValidDivisor">IsValidDivisor</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<T as <a class="trait" href="../bool_mask/trait.HasBoolMask.html" title="trait cosmic::cosmic_theme::palette::bool_mask::HasBoolMask">HasBoolMask</a>>::<a class="associatedtype" href="../bool_mask/trait.HasBoolMask.html#associatedtype.Mask" title="type cosmic::cosmic_theme::palette::bool_mask::HasBoolMask::Mask">Mask</a>: <a class="trait" href="../bool_mask/trait.LazySelect.html" title="trait cosmic::cosmic_theme::palette::bool_mask::LazySelect">LazySelect</a><T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Scalar-2" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/rgb/rgb.rs.html#973">Source</a><a href="#associatedtype.Scalar-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a> = T</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Premultiply-for-Cam16UcsJab%3CT%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/cam16/ucs_jab.rs.html#267">Source</a><a href="#impl-Premultiply-for-Cam16UcsJab%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a> for <a class="struct" href="../cam16/struct.Cam16UcsJab.html" title="struct cosmic::cosmic_theme::palette::cam16::Cam16UcsJab">Cam16UcsJab</a><T><div class="where">where
|
||||
T: <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.IsValidDivisor.html" title="trait cosmic::cosmic_theme::palette::num::IsValidDivisor">IsValidDivisor</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><Output = T> + <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<T as <a class="trait" href="../bool_mask/trait.HasBoolMask.html" title="trait cosmic::cosmic_theme::palette::bool_mask::HasBoolMask">HasBoolMask</a>>::<a class="associatedtype" href="../bool_mask/trait.HasBoolMask.html#associatedtype.Mask" title="type cosmic::cosmic_theme::palette::bool_mask::HasBoolMask::Mask">Mask</a>: <a class="trait" href="../bool_mask/trait.LazySelect.html" title="trait cosmic::cosmic_theme::palette::bool_mask::LazySelect">LazySelect</a><T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Scalar-3" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/cam16/ucs_jab.rs.html#267">Source</a><a href="#associatedtype.Scalar-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a> = T</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Premultiply-for-Oklab%3CT%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/oklab/properties.rs.html#29">Source</a><a href="#impl-Premultiply-for-Oklab%3CT%3E" class="anchor">§</a><h3 class="code-header">impl<T> <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a> for <a class="struct" href="../struct.Oklab.html" title="struct cosmic::cosmic_theme::palette::Oklab">Oklab</a><T><div class="where">where
|
||||
T: <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.IsValidDivisor.html" title="trait cosmic::cosmic_theme::palette::num::IsValidDivisor">IsValidDivisor</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><Output = T> + <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<T as <a class="trait" href="../bool_mask/trait.HasBoolMask.html" title="trait cosmic::cosmic_theme::palette::bool_mask::HasBoolMask">HasBoolMask</a>>::<a class="associatedtype" href="../bool_mask/trait.HasBoolMask.html#associatedtype.Mask" title="type cosmic::cosmic_theme::palette::bool_mask::HasBoolMask::Mask">Mask</a>: <a class="trait" href="../bool_mask/trait.LazySelect.html" title="trait cosmic::cosmic_theme::palette::bool_mask::LazySelect">LazySelect</a><T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Scalar-4" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/oklab/properties.rs.html#29">Source</a><a href="#associatedtype.Scalar-4" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a> = T</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Premultiply-for-Lab%3CWp,+T%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/lab.rs.html#231">Source</a><a href="#impl-Premultiply-for-Lab%3CWp,+T%3E" class="anchor">§</a><h3 class="code-header">impl<Wp, T> <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a> for <a class="struct" href="../struct.Lab.html" title="struct cosmic::cosmic_theme::palette::Lab">Lab</a><Wp, T><div class="where">where
|
||||
T: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.IsValidDivisor.html" title="trait cosmic::cosmic_theme::palette::num::IsValidDivisor">IsValidDivisor</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<T as <a class="trait" href="../bool_mask/trait.HasBoolMask.html" title="trait cosmic::cosmic_theme::palette::bool_mask::HasBoolMask">HasBoolMask</a>>::<a class="associatedtype" href="../bool_mask/trait.HasBoolMask.html#associatedtype.Mask" title="type cosmic::cosmic_theme::palette::bool_mask::HasBoolMask::Mask">Mask</a>: <a class="trait" href="../bool_mask/trait.LazySelect.html" title="trait cosmic::cosmic_theme::palette::bool_mask::LazySelect">LazySelect</a><T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Scalar-5" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/lab.rs.html#231">Source</a><a href="#associatedtype.Scalar-5" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a> = T</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Premultiply-for-Luv%3CWp,+T%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/luv.rs.html#233">Source</a><a href="#impl-Premultiply-for-Luv%3CWp,+T%3E" class="anchor">§</a><h3 class="code-header">impl<Wp, T> <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a> for <a class="struct" href="../struct.Luv.html" title="struct cosmic::cosmic_theme::palette::Luv">Luv</a><Wp, T><div class="where">where
|
||||
T: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.IsValidDivisor.html" title="trait cosmic::cosmic_theme::palette::num::IsValidDivisor">IsValidDivisor</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<T as <a class="trait" href="../bool_mask/trait.HasBoolMask.html" title="trait cosmic::cosmic_theme::palette::bool_mask::HasBoolMask">HasBoolMask</a>>::<a class="associatedtype" href="../bool_mask/trait.HasBoolMask.html#associatedtype.Mask" title="type cosmic::cosmic_theme::palette::bool_mask::HasBoolMask::Mask">Mask</a>: <a class="trait" href="../bool_mask/trait.LazySelect.html" title="trait cosmic::cosmic_theme::palette::bool_mask::LazySelect">LazySelect</a><T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Scalar-6" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/luv.rs.html#233">Source</a><a href="#associatedtype.Scalar-6" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a> = T</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Premultiply-for-Xyz%3CWp,+T%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/xyz.rs.html#420">Source</a><a href="#impl-Premultiply-for-Xyz%3CWp,+T%3E" class="anchor">§</a><h3 class="code-header">impl<Wp, T> <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a> for <a class="struct" href="../struct.Xyz.html" title="struct cosmic::cosmic_theme::palette::Xyz">Xyz</a><Wp, T><div class="where">where
|
||||
T: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.IsValidDivisor.html" title="trait cosmic::cosmic_theme::palette::num::IsValidDivisor">IsValidDivisor</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<T as <a class="trait" href="../bool_mask/trait.HasBoolMask.html" title="trait cosmic::cosmic_theme::palette::bool_mask::HasBoolMask">HasBoolMask</a>>::<a class="associatedtype" href="../bool_mask/trait.HasBoolMask.html#associatedtype.Mask" title="type cosmic::cosmic_theme::palette::bool_mask::HasBoolMask::Mask">Mask</a>: <a class="trait" href="../bool_mask/trait.LazySelect.html" title="trait cosmic::cosmic_theme::palette::bool_mask::LazySelect">LazySelect</a><T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Scalar-7" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/xyz.rs.html#420">Source</a><a href="#associatedtype.Scalar-7" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a> = T</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Premultiply-for-Yxy%3CWp,+T%3E" class="impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/yxy.rs.html#235">Source</a><a href="#impl-Premultiply-for-Yxy%3CWp,+T%3E" class="anchor">§</a><h3 class="code-header">impl<Wp, T> <a class="trait" href="trait.Premultiply.html" title="trait cosmic::cosmic_theme::palette::blend::Premultiply">Premultiply</a> for <a class="struct" href="../struct.Yxy.html" title="struct cosmic::cosmic_theme::palette::Yxy">Yxy</a><Wp, T><div class="where">where
|
||||
T: <a class="trait" href="../num/trait.Real.html" title="trait cosmic::cosmic_theme::palette::num::Real">Real</a> + <a class="trait" href="../stimulus/trait.Stimulus.html" title="trait cosmic::cosmic_theme::palette::stimulus::Stimulus">Stimulus</a> + <a class="trait" href="../num/trait.Zero.html" title="trait cosmic::cosmic_theme::palette::num::Zero">Zero</a> + <a class="trait" href="../num/trait.IsValidDivisor.html" title="trait cosmic::cosmic_theme::palette::num::IsValidDivisor">IsValidDivisor</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Mul.html" title="trait core::ops::arith::Mul">Mul</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/arith/trait.Div.html" title="trait core::ops::arith::Div">Div</a><Output = T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,
|
||||
<T as <a class="trait" href="../bool_mask/trait.HasBoolMask.html" title="trait cosmic::cosmic_theme::palette::bool_mask::HasBoolMask">HasBoolMask</a>>::<a class="associatedtype" href="../bool_mask/trait.HasBoolMask.html#associatedtype.Mask" title="type cosmic::cosmic_theme::palette::bool_mask::HasBoolMask::Mask">Mask</a>: <a class="trait" href="../bool_mask/trait.LazySelect.html" title="trait cosmic::cosmic_theme::palette::bool_mask::LazySelect">LazySelect</a><T> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><div class="impl-items"><section id="associatedtype.Scalar-8" class="associatedtype trait-impl"><a class="src rightside" href="https://docs.rs/palette/0.7.6/src/palette/yxy.rs.html#235">Source</a><a href="#associatedtype.Scalar-8" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Scalar" class="associatedtype">Scalar</a> = T</h4></section></div></details></div><script src="../../../../trait.impl/palette/blend/trait.Premultiply.js" data-ignore-extern-crates="palette" async></script></section></div></main></body></html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue