pub struct Color(pub Arc<Color>);Expand description
Elicitation-enabled wrapper around bevy::color::Color.
This newtype uses Arc internally to ensure Clone is always available,
providing transparent access via Deref and DerefMut.
Tuple Fields§
§0: Arc<Color>Implementations§
Source§impl Color
impl Color
Sourcepub fn to_linear(&self) -> LinearRgba
pub fn to_linear(&self) -> LinearRgba
Converts to linear RGB color space.
Sourcepub fn color_alpha(&self) -> f32
pub fn color_alpha(&self) -> f32
Alpha component.
Sourcepub fn color_with_alpha(&self, alpha: f32) -> Color
pub fn color_with_alpha(&self, alpha: f32) -> Color
Returns a copy with alpha set to alpha.
Sourcepub fn color_is_fully_transparent(&self) -> bool
pub fn color_is_fully_transparent(&self) -> bool
Returns true if the color is fully transparent.
Sourcepub fn color_is_fully_opaque(&self) -> bool
pub fn color_is_fully_opaque(&self) -> bool
Returns true if the color is fully opaque.
Sourcepub fn linear_slow_transition(&self, end: Color, f: f32) -> Color
pub fn linear_slow_transition(&self, end: Color, f: f32) -> Color
Linearly interpolates between self and end in linear RGB space.
Sourcepub fn variant_name(&self) -> &'static str
pub fn variant_name(&self) -> &'static str
Variant name, e.g. "Srgba", "LinearRgba".
Sourcepub fn is_linear_rgba(&self) -> bool
pub fn is_linear_rgba(&self) -> bool
Returns true if this color is stored in the LinearRgba variant.
Sourcepub fn srgb(&self, r: f32, g: f32, b: f32) -> Color
pub fn srgb(&self, r: f32, g: f32, b: f32) -> Color
Constructs from sRGB r, g, b with alpha = 1.0 (ignores self).
Sourcepub fn srgb_from_hex(&self, hex: &str) -> Option<Color>
pub fn srgb_from_hex(&self, hex: &str) -> Option<Color>
Constructs from a CSS hex string (ignores self).
Source§impl Color
impl Color
Sourcepub fn to_srgba_tool_tool_attr() -> Tool
pub fn to_srgba_tool_tool_attr() -> Tool
Generated tool metadata function for to_srgba_tool
Sourcepub fn to_srgba_tool(&self) -> Result<Json<Srgba>, ErrorData>
pub fn to_srgba_tool(&self) -> Result<Json<Srgba>, ErrorData>
to_srgba MCP tool wrapper method.
Sourcepub fn to_linear_tool_tool_attr() -> Tool
pub fn to_linear_tool_tool_attr() -> Tool
Generated tool metadata function for to_linear_tool
Sourcepub fn to_linear_tool(&self) -> Result<Json<LinearRgba>, ErrorData>
pub fn to_linear_tool(&self) -> Result<Json<LinearRgba>, ErrorData>
to_linear MCP tool wrapper method.
Sourcepub fn to_hsla_tool_tool_attr() -> Tool
pub fn to_hsla_tool_tool_attr() -> Tool
Generated tool metadata function for to_hsla_tool
Sourcepub fn to_oklaba_tool_tool_attr() -> Tool
pub fn to_oklaba_tool_tool_attr() -> Tool
Generated tool metadata function for to_oklaba_tool
Sourcepub fn to_oklaba_tool(&self) -> Result<Json<Oklaba>, ErrorData>
pub fn to_oklaba_tool(&self) -> Result<Json<Oklaba>, ErrorData>
to_oklaba MCP tool wrapper method.
Sourcepub fn color_alpha_tool_tool_attr() -> Tool
pub fn color_alpha_tool_tool_attr() -> Tool
Generated tool metadata function for color_alpha_tool
Sourcepub fn color_alpha_tool(&self) -> Result<Json<f32>, ErrorData>
pub fn color_alpha_tool(&self) -> Result<Json<f32>, ErrorData>
color_alpha MCP tool wrapper method.
Sourcepub fn color_with_alpha_tool_tool_attr() -> Tool
pub fn color_with_alpha_tool_tool_attr() -> Tool
Generated tool metadata function for color_with_alpha_tool
Sourcepub fn color_with_alpha_tool(
&self,
params: Parameters<ColorWithAlphaParams>,
) -> Result<Json<Color>, ErrorData>
pub fn color_with_alpha_tool( &self, params: Parameters<ColorWithAlphaParams>, ) -> Result<Json<Color>, ErrorData>
color_with_alpha MCP tool wrapper method.
Sourcepub fn color_is_fully_transparent_tool_tool_attr() -> Tool
pub fn color_is_fully_transparent_tool_tool_attr() -> Tool
Generated tool metadata function for color_is_fully_transparent_tool
Sourcepub fn color_is_fully_transparent_tool(&self) -> Result<Json<bool>, ErrorData>
pub fn color_is_fully_transparent_tool(&self) -> Result<Json<bool>, ErrorData>
color_is_fully_transparent MCP tool wrapper method.
Sourcepub fn color_is_fully_opaque_tool_tool_attr() -> Tool
pub fn color_is_fully_opaque_tool_tool_attr() -> Tool
Generated tool metadata function for color_is_fully_opaque_tool
Sourcepub fn color_is_fully_opaque_tool(&self) -> Result<Json<bool>, ErrorData>
pub fn color_is_fully_opaque_tool(&self) -> Result<Json<bool>, ErrorData>
color_is_fully_opaque MCP tool wrapper method.
Sourcepub fn linear_slow_transition_tool_tool_attr() -> Tool
pub fn linear_slow_transition_tool_tool_attr() -> Tool
Generated tool metadata function for linear_slow_transition_tool
Sourcepub fn linear_slow_transition_tool(
&self,
params: Parameters<LinearSlowTransitionParams>,
) -> Result<Json<Color>, ErrorData>
pub fn linear_slow_transition_tool( &self, params: Parameters<LinearSlowTransitionParams>, ) -> Result<Json<Color>, ErrorData>
linear_slow_transition MCP tool wrapper method.
Sourcepub fn variant_name_tool_tool_attr() -> Tool
pub fn variant_name_tool_tool_attr() -> Tool
Generated tool metadata function for variant_name_tool
Sourcepub fn variant_name_tool(&self) -> Result<Json<&'static str>, ErrorData>
pub fn variant_name_tool(&self) -> Result<Json<&'static str>, ErrorData>
variant_name MCP tool wrapper method.
Sourcepub fn is_srgba_tool_tool_attr() -> Tool
pub fn is_srgba_tool_tool_attr() -> Tool
Generated tool metadata function for is_srgba_tool
Sourcepub fn is_linear_rgba_tool_tool_attr() -> Tool
pub fn is_linear_rgba_tool_tool_attr() -> Tool
Generated tool metadata function for is_linear_rgba_tool
Sourcepub fn is_linear_rgba_tool(&self) -> Result<Json<bool>, ErrorData>
pub fn is_linear_rgba_tool(&self) -> Result<Json<bool>, ErrorData>
is_linear_rgba MCP tool wrapper method.
Sourcepub fn is_hsla_tool_tool_attr() -> Tool
pub fn is_hsla_tool_tool_attr() -> Tool
Generated tool metadata function for is_hsla_tool
Sourcepub fn white_tool_tool_attr() -> Tool
pub fn white_tool_tool_attr() -> Tool
Generated tool metadata function for white_tool
Sourcepub fn black_tool_tool_attr() -> Tool
pub fn black_tool_tool_attr() -> Tool
Generated tool metadata function for black_tool
Sourcepub fn none_tool_tool_attr() -> Tool
pub fn none_tool_tool_attr() -> Tool
Generated tool metadata function for none_tool
Sourcepub fn srgb_tool_tool_attr() -> Tool
pub fn srgb_tool_tool_attr() -> Tool
Generated tool metadata function for srgb_tool
Sourcepub fn srgb_tool(
&self,
params: Parameters<SrgbParams>,
) -> Result<Json<Color>, ErrorData>
pub fn srgb_tool( &self, params: Parameters<SrgbParams>, ) -> Result<Json<Color>, ErrorData>
srgb MCP tool wrapper method.
Sourcepub fn srgb_from_hex_tool_tool_attr() -> Tool
pub fn srgb_from_hex_tool_tool_attr() -> Tool
Generated tool metadata function for srgb_from_hex_tool
Sourcepub fn srgb_from_hex_tool(
&self,
params: Parameters<SrgbFromHexParams>,
) -> Result<Json<Option<Color>>, ErrorData>
pub fn srgb_from_hex_tool( &self, params: Parameters<SrgbFromHexParams>, ) -> Result<Json<Option<Color>>, ErrorData>
srgb_from_hex MCP tool wrapper method.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Color
impl<'de> Deserialize<'de> for Color
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl ElicitComplete for Color
impl ElicitComplete for Color
Source§fn validate_proofs_non_empty() -> bool
fn validate_proofs_non_empty() -> bool
Source§fn kani_proof_contains<Inner>() -> boolwhere
Inner: Elicitation,
fn kani_proof_contains<Inner>() -> boolwhere
Inner: Elicitation,
Inner’s Kani proof? Read moreSource§fn verus_proof_contains<Inner>() -> boolwhere
Inner: Elicitation,
fn verus_proof_contains<Inner>() -> boolwhere
Inner: Elicitation,
Inner’s Verus proof?Source§fn creusot_proof_contains<Inner>() -> boolwhere
Inner: Elicitation,
fn creusot_proof_contains<Inner>() -> boolwhere
Inner: Elicitation,
Inner’s Creusot proof?Source§impl ElicitIntrospect for Color
impl ElicitIntrospect for Color
Source§fn pattern() -> ElicitationPattern
fn pattern() -> ElicitationPattern
Source§fn metadata() -> TypeMetadata
fn metadata() -> TypeMetadata
Source§impl ElicitPromptTree for Color
impl ElicitPromptTree for Color
Source§fn prompt_tree() -> PromptTree
fn prompt_tree() -> PromptTree
Source§fn assembled_prompts() -> Vec<AssembledPrompt>
fn assembled_prompts() -> Vec<AssembledPrompt>
Source§impl ElicitSpec for Color
impl ElicitSpec for Color
Source§impl Elicitation for Color
impl Elicitation for Color
Source§async fn elicit<C: ElicitCommunicator>(_communicator: &C) -> ElicitResult<Self>
async fn elicit<C: ElicitCommunicator>(_communicator: &C) -> ElicitResult<Self>
Source§fn kani_proof() -> TokenStream
fn kani_proof() -> TokenStream
Source§fn verus_proof() -> TokenStream
fn verus_proof() -> TokenStream
proc_macro2::TokenStream containing a Verus-verified function
with requires/ensures specifications for this type’s invariants. Read moreSource§fn creusot_proof() -> TokenStream
fn creusot_proof() -> TokenStream
proc_macro2::TokenStream containing Creusot contract functions
with #[requires]/#[ensures]/#[trusted] attributes for this type’s invariants. Read moreSource§fn elicit_checked(
peer: Peer<RoleServer>,
) -> impl Future<Output = Result<Self, ElicitError>> + Send
fn elicit_checked( peer: Peer<RoleServer>, ) -> impl Future<Output = Result<Self, ElicitError>> + Send
Source§fn with_style(style: Self::Style) -> ElicitBuilder<Self>
fn with_style(style: Self::Style) -> ElicitBuilder<Self>
Source§fn elicit_proven<C>(
communicator: &C,
) -> impl Future<Output = Result<(Self, Established<Is<Self>>), ElicitError>> + Sendwhere
C: ElicitCommunicator,
fn elicit_proven<C>(
communicator: &C,
) -> impl Future<Output = Result<(Self, Established<Is<Self>>), ElicitError>> + Sendwhere
C: ElicitCommunicator,
Source§fn prusti_proof() -> TokenStream
fn prusti_proof() -> TokenStream
proc_macro2::TokenStream containing Prusti contract functions
with #[requires]/#[ensures] attributes for this type’s invariants. Read moreimpl Eq for Color
Source§impl JsonSchema for Color
impl JsonSchema for Color
Source§fn json_schema(_gen: &mut SchemaGenerator) -> Schema
fn json_schema(_gen: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl ToCodeLiteral for Color
impl ToCodeLiteral for Color
Source§fn to_code_literal(&self) -> TokenStream
fn to_code_literal(&self) -> TokenStream
TokenStream containing a single Rust expression whose
evaluation produces a value equal to self.Source§fn type_tokens() -> TokenStreamwhere
Self: Sized,
fn type_tokens() -> TokenStreamwhere
Self: Sized,
None::<T>). Read moreAuto Trait Implementations§
impl Freeze for Color
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnsafeUnpin for Color
impl UnwindSafe for Color
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<T> ElicitJson for T
impl<T> ElicitJson for T
Source§async fn elicit_json<C>(communicator: &C) -> Result<T, ElicitError>where
C: ElicitCommunicator,
async fn elicit_json<C>(communicator: &C) -> Result<T, ElicitError>where
C: ElicitCommunicator,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more