130 lines
2.9 KiB
Plaintext
130 lines
2.9 KiB
Plaintext
// Generated using `moon info`, DON'T EDIT IT
|
|
package "experiments/gpui/color"
|
|
|
|
import {
|
|
"moonbitlang/core/debug",
|
|
}
|
|
|
|
// Values
|
|
pub fn black() -> Hsla
|
|
|
|
pub fn blue() -> Hsla
|
|
|
|
pub fn checkerboard(Hsla, Double) -> Background
|
|
|
|
pub fn green() -> Hsla
|
|
|
|
pub fn hsla(Double, Double, Double, Double) -> Hsla
|
|
|
|
pub fn linear_color_stop(Hsla, Double) -> LinearColorStop
|
|
|
|
pub fn linear_gradient(Double, LinearColorStop, LinearColorStop) -> Background
|
|
|
|
pub fn opaque_grey(Double, Double) -> Hsla
|
|
|
|
pub fn pattern_slash(Hsla, Double, Double) -> Background
|
|
|
|
pub fn red() -> Hsla
|
|
|
|
pub fn rgb(UInt32) -> Rgba
|
|
|
|
pub fn rgba(UInt32) -> Rgba
|
|
|
|
pub fn solid_background(Hsla) -> Background
|
|
|
|
pub fn transparent_black() -> Hsla
|
|
|
|
pub fn transparent_white() -> Hsla
|
|
|
|
pub fn white() -> Hsla
|
|
|
|
pub fn yellow() -> Hsla
|
|
|
|
// Errors
|
|
#derive(@debug.Debug)
|
|
pub suberror ColorParseError {
|
|
ColorParseError(input~ : String, reason~ : String)
|
|
}
|
|
|
|
// Types and methods
|
|
#derive(Default, Eq, @debug.Debug)
|
|
pub(all) struct Background {
|
|
tag : BackgroundTag
|
|
color_space : ColorSpace
|
|
solid : Hsla
|
|
gradient_angle_or_pattern_height : Double
|
|
colors : (LinearColorStop, LinearColorStop)
|
|
}
|
|
pub fn Background::as_solid(Self) -> Hsla?
|
|
pub fn Background::is_transparent(Self) -> Bool
|
|
pub fn Background::opacity(Self, Double) -> Self
|
|
pub fn Background::with_color_space(Self, ColorSpace) -> Self
|
|
|
|
#derive(Eq, @debug.Debug)
|
|
pub(all) enum BackgroundTag {
|
|
Solid
|
|
LinearGradient
|
|
PatternSlash
|
|
Checkerboard
|
|
}
|
|
pub impl Default for BackgroundTag
|
|
|
|
#derive(Eq, @debug.Debug)
|
|
pub(all) enum ColorSpace {
|
|
Srgb
|
|
Oklab
|
|
}
|
|
pub impl Default for ColorSpace
|
|
pub impl Show for ColorSpace
|
|
|
|
#derive(Compare, Default, Eq, Hash, @debug.Debug)
|
|
pub(all) struct Hsla {
|
|
h : Double
|
|
s : Double
|
|
l : Double
|
|
a : Double
|
|
}
|
|
pub fn Hsla::alpha(Self, Double) -> Self
|
|
pub fn Hsla::blend(Self, Self) -> Self
|
|
pub fn Hsla::fade_out(Self, Double) -> Self
|
|
pub fn Hsla::grayscale(Self) -> Self
|
|
pub fn Hsla::is_opaque(Self) -> Bool
|
|
pub fn Hsla::is_transparent(Self) -> Bool
|
|
pub fn Hsla::opacity(Self, Double) -> Self
|
|
pub fn Hsla::to_background(Self) -> Background
|
|
pub fn Hsla::to_rgb(Self) -> Rgba
|
|
pub impl IntoHsla for Hsla
|
|
pub impl Show for Hsla
|
|
|
|
#derive(Default, Eq, @debug.Debug)
|
|
pub(all) struct LinearColorStop {
|
|
color : Hsla
|
|
percentage : Double
|
|
}
|
|
pub fn LinearColorStop::opacity(Self, Double) -> Self
|
|
|
|
#derive(Default, Eq, @debug.Debug)
|
|
pub(all) struct Rgba {
|
|
r : Double
|
|
g : Double
|
|
b : Double
|
|
a : Double
|
|
}
|
|
pub fn Rgba::alpha(Self, Double) -> Self
|
|
pub fn Rgba::blend(Self, Self) -> Self
|
|
pub fn Rgba::opacity(Self, Double) -> Self
|
|
pub fn Rgba::parse(String) -> Self raise ColorParseError
|
|
pub fn Rgba::to_background(Self) -> Background
|
|
pub fn Rgba::to_hex(Self) -> String
|
|
pub fn Rgba::to_hsla(Self) -> Hsla
|
|
pub fn Rgba::to_u32(Self) -> UInt32
|
|
pub impl IntoHsla for Rgba
|
|
pub impl Show for Rgba
|
|
|
|
// Type aliases
|
|
|
|
// Traits
|
|
pub(open) trait IntoHsla {
|
|
fn into_hsla(Self) -> Hsla
|
|
}
|