mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 06:05:19 +00:00
Merge branch 'main' into n/t2
This commit is contained in:
commit
8fb7c174b0
3 changed files with 195 additions and 98 deletions
|
@ -118,7 +118,7 @@ impl Codegen {
|
||||||
|
|
||||||
let (mut hunks_tx, mut hunks_rx) = mpsc::channel(1);
|
let (mut hunks_tx, mut hunks_rx) = mpsc::channel(1);
|
||||||
let diff = cx.background().spawn(async move {
|
let diff = cx.background().spawn(async move {
|
||||||
let chunks = strip_markdown_codeblock(response.await?);
|
let chunks = strip_invalid_spans_from_codeblock(response.await?);
|
||||||
futures::pin_mut!(chunks);
|
futures::pin_mut!(chunks);
|
||||||
let mut diff = StreamingDiff::new(selected_text.to_string());
|
let mut diff = StreamingDiff::new(selected_text.to_string());
|
||||||
|
|
||||||
|
@ -279,12 +279,13 @@ impl Codegen {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn strip_markdown_codeblock(
|
fn strip_invalid_spans_from_codeblock(
|
||||||
stream: impl Stream<Item = Result<String>>,
|
stream: impl Stream<Item = Result<String>>,
|
||||||
) -> impl Stream<Item = Result<String>> {
|
) -> impl Stream<Item = Result<String>> {
|
||||||
let mut first_line = true;
|
let mut first_line = true;
|
||||||
let mut buffer = String::new();
|
let mut buffer = String::new();
|
||||||
let mut starts_with_fenced_code_block = false;
|
let mut starts_with_markdown_codeblock = false;
|
||||||
|
let mut includes_start_or_end_span = false;
|
||||||
stream.filter_map(move |chunk| {
|
stream.filter_map(move |chunk| {
|
||||||
let chunk = match chunk {
|
let chunk = match chunk {
|
||||||
Ok(chunk) => chunk,
|
Ok(chunk) => chunk,
|
||||||
|
@ -292,11 +293,31 @@ fn strip_markdown_codeblock(
|
||||||
};
|
};
|
||||||
buffer.push_str(&chunk);
|
buffer.push_str(&chunk);
|
||||||
|
|
||||||
|
if buffer.len() > "<|S|".len() && buffer.starts_with("<|S|") {
|
||||||
|
includes_start_or_end_span = true;
|
||||||
|
|
||||||
|
buffer = buffer
|
||||||
|
.strip_prefix("<|S|>")
|
||||||
|
.or_else(|| buffer.strip_prefix("<|S|"))
|
||||||
|
.unwrap_or(&buffer)
|
||||||
|
.to_string();
|
||||||
|
} else if buffer.ends_with("|E|>") {
|
||||||
|
includes_start_or_end_span = true;
|
||||||
|
} else if buffer.starts_with("<|")
|
||||||
|
|| buffer.starts_with("<|S")
|
||||||
|
|| buffer.starts_with("<|S|")
|
||||||
|
|| buffer.ends_with("|")
|
||||||
|
|| buffer.ends_with("|E")
|
||||||
|
|| buffer.ends_with("|E|")
|
||||||
|
{
|
||||||
|
return future::ready(None);
|
||||||
|
}
|
||||||
|
|
||||||
if first_line {
|
if first_line {
|
||||||
if buffer == "" || buffer == "`" || buffer == "``" {
|
if buffer == "" || buffer == "`" || buffer == "``" {
|
||||||
return future::ready(None);
|
return future::ready(None);
|
||||||
} else if buffer.starts_with("```") {
|
} else if buffer.starts_with("```") {
|
||||||
starts_with_fenced_code_block = true;
|
starts_with_markdown_codeblock = true;
|
||||||
if let Some(newline_ix) = buffer.find('\n') {
|
if let Some(newline_ix) = buffer.find('\n') {
|
||||||
buffer.replace_range(..newline_ix + 1, "");
|
buffer.replace_range(..newline_ix + 1, "");
|
||||||
first_line = false;
|
first_line = false;
|
||||||
|
@ -306,16 +327,26 @@ fn strip_markdown_codeblock(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let text = if starts_with_fenced_code_block {
|
let mut text = buffer.to_string();
|
||||||
buffer
|
if starts_with_markdown_codeblock {
|
||||||
|
text = text
|
||||||
.strip_suffix("\n```\n")
|
.strip_suffix("\n```\n")
|
||||||
.or_else(|| buffer.strip_suffix("\n```"))
|
.or_else(|| text.strip_suffix("\n```"))
|
||||||
.or_else(|| buffer.strip_suffix("\n``"))
|
.or_else(|| text.strip_suffix("\n``"))
|
||||||
.or_else(|| buffer.strip_suffix("\n`"))
|
.or_else(|| text.strip_suffix("\n`"))
|
||||||
.or_else(|| buffer.strip_suffix('\n'))
|
.or_else(|| text.strip_suffix('\n'))
|
||||||
.unwrap_or(&buffer)
|
.unwrap_or(&text)
|
||||||
} else {
|
.to_string();
|
||||||
&buffer
|
}
|
||||||
|
|
||||||
|
if includes_start_or_end_span {
|
||||||
|
text = text
|
||||||
|
.strip_suffix("|E|>")
|
||||||
|
.or_else(|| text.strip_suffix("E|>"))
|
||||||
|
.or_else(|| text.strip_prefix("|>"))
|
||||||
|
.or_else(|| text.strip_prefix(">"))
|
||||||
|
.unwrap_or(&text)
|
||||||
|
.to_string();
|
||||||
};
|
};
|
||||||
|
|
||||||
if text.contains('\n') {
|
if text.contains('\n') {
|
||||||
|
@ -328,6 +359,7 @@ fn strip_markdown_codeblock(
|
||||||
} else {
|
} else {
|
||||||
Some(Ok(buffer.clone()))
|
Some(Ok(buffer.clone()))
|
||||||
};
|
};
|
||||||
|
|
||||||
buffer = remainder;
|
buffer = remainder;
|
||||||
future::ready(result)
|
future::ready(result)
|
||||||
})
|
})
|
||||||
|
@ -558,50 +590,82 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
async fn test_strip_markdown_codeblock() {
|
async fn test_strip_invalid_spans_from_codeblock() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
strip_markdown_codeblock(chunks("Lorem ipsum dolor", 2))
|
strip_invalid_spans_from_codeblock(chunks("Lorem ipsum dolor", 2))
|
||||||
.map(|chunk| chunk.unwrap())
|
.map(|chunk| chunk.unwrap())
|
||||||
.collect::<String>()
|
.collect::<String>()
|
||||||
.await,
|
.await,
|
||||||
"Lorem ipsum dolor"
|
"Lorem ipsum dolor"
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
strip_markdown_codeblock(chunks("```\nLorem ipsum dolor", 2))
|
strip_invalid_spans_from_codeblock(chunks("```\nLorem ipsum dolor", 2))
|
||||||
.map(|chunk| chunk.unwrap())
|
.map(|chunk| chunk.unwrap())
|
||||||
.collect::<String>()
|
.collect::<String>()
|
||||||
.await,
|
.await,
|
||||||
"Lorem ipsum dolor"
|
"Lorem ipsum dolor"
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
strip_markdown_codeblock(chunks("```\nLorem ipsum dolor\n```", 2))
|
strip_invalid_spans_from_codeblock(chunks("```\nLorem ipsum dolor\n```", 2))
|
||||||
.map(|chunk| chunk.unwrap())
|
.map(|chunk| chunk.unwrap())
|
||||||
.collect::<String>()
|
.collect::<String>()
|
||||||
.await,
|
.await,
|
||||||
"Lorem ipsum dolor"
|
"Lorem ipsum dolor"
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
strip_markdown_codeblock(chunks("```\nLorem ipsum dolor\n```\n", 2))
|
strip_invalid_spans_from_codeblock(chunks("```\nLorem ipsum dolor\n```\n", 2))
|
||||||
.map(|chunk| chunk.unwrap())
|
.map(|chunk| chunk.unwrap())
|
||||||
.collect::<String>()
|
.collect::<String>()
|
||||||
.await,
|
.await,
|
||||||
"Lorem ipsum dolor"
|
"Lorem ipsum dolor"
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
strip_markdown_codeblock(chunks("```html\n```js\nLorem ipsum dolor\n```\n```", 2))
|
strip_invalid_spans_from_codeblock(chunks(
|
||||||
.map(|chunk| chunk.unwrap())
|
"```html\n```js\nLorem ipsum dolor\n```\n```",
|
||||||
.collect::<String>()
|
2
|
||||||
.await,
|
))
|
||||||
|
.map(|chunk| chunk.unwrap())
|
||||||
|
.collect::<String>()
|
||||||
|
.await,
|
||||||
"```js\nLorem ipsum dolor\n```"
|
"```js\nLorem ipsum dolor\n```"
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
strip_markdown_codeblock(chunks("``\nLorem ipsum dolor\n```", 2))
|
strip_invalid_spans_from_codeblock(chunks("``\nLorem ipsum dolor\n```", 2))
|
||||||
.map(|chunk| chunk.unwrap())
|
.map(|chunk| chunk.unwrap())
|
||||||
.collect::<String>()
|
.collect::<String>()
|
||||||
.await,
|
.await,
|
||||||
"``\nLorem ipsum dolor\n```"
|
"``\nLorem ipsum dolor\n```"
|
||||||
);
|
);
|
||||||
|
assert_eq!(
|
||||||
|
strip_invalid_spans_from_codeblock(chunks("<|S|Lorem ipsum|E|>", 2))
|
||||||
|
.map(|chunk| chunk.unwrap())
|
||||||
|
.collect::<String>()
|
||||||
|
.await,
|
||||||
|
"Lorem ipsum"
|
||||||
|
);
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
strip_invalid_spans_from_codeblock(chunks("<|S|>Lorem ipsum", 2))
|
||||||
|
.map(|chunk| chunk.unwrap())
|
||||||
|
.collect::<String>()
|
||||||
|
.await,
|
||||||
|
"Lorem ipsum"
|
||||||
|
);
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
strip_invalid_spans_from_codeblock(chunks("```\n<|S|>Lorem ipsum\n```", 2))
|
||||||
|
.map(|chunk| chunk.unwrap())
|
||||||
|
.collect::<String>()
|
||||||
|
.await,
|
||||||
|
"Lorem ipsum"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
strip_invalid_spans_from_codeblock(chunks("```\n<|S|Lorem ipsum|E|>\n```", 2))
|
||||||
|
.map(|chunk| chunk.unwrap())
|
||||||
|
.collect::<String>()
|
||||||
|
.await,
|
||||||
|
"Lorem ipsum"
|
||||||
|
);
|
||||||
fn chunks(text: &str, size: usize) -> impl Stream<Item = Result<String>> {
|
fn chunks(text: &str, size: usize) -> impl Stream<Item = Result<String>> {
|
||||||
stream::iter(
|
stream::iter(
|
||||||
text.chars()
|
text.chars()
|
||||||
|
|
|
@ -80,12 +80,12 @@ fn summarize(buffer: &BufferSnapshot, selected_range: Range<impl ToOffset>) -> S
|
||||||
if !flushed_selection {
|
if !flushed_selection {
|
||||||
// The collapsed node ends after the selection starts, so we'll flush the selection first.
|
// The collapsed node ends after the selection starts, so we'll flush the selection first.
|
||||||
summary.extend(buffer.text_for_range(offset..selected_range.start));
|
summary.extend(buffer.text_for_range(offset..selected_range.start));
|
||||||
summary.push_str("<|START|");
|
summary.push_str("<|S|");
|
||||||
if selected_range.end == selected_range.start {
|
if selected_range.end == selected_range.start {
|
||||||
summary.push_str(">");
|
summary.push_str(">");
|
||||||
} else {
|
} else {
|
||||||
summary.extend(buffer.text_for_range(selected_range.clone()));
|
summary.extend(buffer.text_for_range(selected_range.clone()));
|
||||||
summary.push_str("|END|>");
|
summary.push_str("|E|>");
|
||||||
}
|
}
|
||||||
offset = selected_range.end;
|
offset = selected_range.end;
|
||||||
flushed_selection = true;
|
flushed_selection = true;
|
||||||
|
@ -107,12 +107,12 @@ fn summarize(buffer: &BufferSnapshot, selected_range: Range<impl ToOffset>) -> S
|
||||||
// Flush selection if we haven't already done so.
|
// Flush selection if we haven't already done so.
|
||||||
if !flushed_selection && offset <= selected_range.start {
|
if !flushed_selection && offset <= selected_range.start {
|
||||||
summary.extend(buffer.text_for_range(offset..selected_range.start));
|
summary.extend(buffer.text_for_range(offset..selected_range.start));
|
||||||
summary.push_str("<|START|");
|
summary.push_str("<|S|");
|
||||||
if selected_range.end == selected_range.start {
|
if selected_range.end == selected_range.start {
|
||||||
summary.push_str(">");
|
summary.push_str(">");
|
||||||
} else {
|
} else {
|
||||||
summary.extend(buffer.text_for_range(selected_range.clone()));
|
summary.extend(buffer.text_for_range(selected_range.clone()));
|
||||||
summary.push_str("|END|>");
|
summary.push_str("|E|>");
|
||||||
}
|
}
|
||||||
offset = selected_range.end;
|
offset = selected_range.end;
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ pub(crate) mod tests {
|
||||||
summarize(&snapshot, Point::new(1, 4)..Point::new(1, 4)),
|
summarize(&snapshot, Point::new(1, 4)..Point::new(1, 4)),
|
||||||
indoc! {"
|
indoc! {"
|
||||||
struct X {
|
struct X {
|
||||||
<|START|>a: usize,
|
<|S|>a: usize,
|
||||||
b: usize,
|
b: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ pub(crate) mod tests {
|
||||||
impl X {
|
impl X {
|
||||||
|
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
let <|START|a |END|>= 1;
|
let <|S|a |E|>= 1;
|
||||||
let b = 2;
|
let b = 2;
|
||||||
Self { a, b }
|
Self { a, b }
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ pub(crate) mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl X {
|
impl X {
|
||||||
<|START|>
|
<|S|>
|
||||||
fn new() -> Self {}
|
fn new() -> Self {}
|
||||||
|
|
||||||
pub fn a(&self, param: bool) -> usize {}
|
pub fn a(&self, param: bool) -> usize {}
|
||||||
|
@ -333,7 +333,7 @@ pub(crate) mod tests {
|
||||||
|
|
||||||
pub fn b(&self) -> usize {}
|
pub fn b(&self) -> usize {}
|
||||||
}
|
}
|
||||||
<|START|>"}
|
<|S|>"}
|
||||||
);
|
);
|
||||||
|
|
||||||
// Ensure nested functions get collapsed properly.
|
// Ensure nested functions get collapsed properly.
|
||||||
|
@ -369,7 +369,7 @@ pub(crate) mod tests {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
summarize(&snapshot, Point::new(0, 0)..Point::new(0, 0)),
|
summarize(&snapshot, Point::new(0, 0)..Point::new(0, 0)),
|
||||||
indoc! {"
|
indoc! {"
|
||||||
<|START|>struct X {
|
<|S|>struct X {
|
||||||
a: usize,
|
a: usize,
|
||||||
b: usize,
|
b: usize,
|
||||||
}
|
}
|
||||||
|
|
|
@ -332,43 +332,43 @@ impl From<DefaultColorScaleSet> for ColorScaleSet {
|
||||||
|
|
||||||
pub fn default_color_scales() -> ColorScales {
|
pub fn default_color_scales() -> ColorScales {
|
||||||
ColorScales {
|
ColorScales {
|
||||||
gray: gray().into(),
|
gray: gray(),
|
||||||
mauve: mauve().into(),
|
mauve: mauve(),
|
||||||
slate: slate().into(),
|
slate: slate(),
|
||||||
sage: sage().into(),
|
sage: sage(),
|
||||||
olive: olive().into(),
|
olive: olive(),
|
||||||
sand: sand().into(),
|
sand: sand(),
|
||||||
gold: gold().into(),
|
gold: gold(),
|
||||||
bronze: bronze().into(),
|
bronze: bronze(),
|
||||||
brown: brown().into(),
|
brown: brown(),
|
||||||
yellow: yellow().into(),
|
yellow: yellow(),
|
||||||
amber: amber().into(),
|
amber: amber(),
|
||||||
orange: orange().into(),
|
orange: orange(),
|
||||||
tomato: tomato().into(),
|
tomato: tomato(),
|
||||||
red: red().into(),
|
red: red(),
|
||||||
ruby: ruby().into(),
|
ruby: ruby(),
|
||||||
crimson: crimson().into(),
|
crimson: crimson(),
|
||||||
pink: pink().into(),
|
pink: pink(),
|
||||||
plum: plum().into(),
|
plum: plum(),
|
||||||
purple: purple().into(),
|
purple: purple(),
|
||||||
violet: violet().into(),
|
violet: violet(),
|
||||||
iris: iris().into(),
|
iris: iris(),
|
||||||
indigo: indigo().into(),
|
indigo: indigo(),
|
||||||
blue: blue().into(),
|
blue: blue(),
|
||||||
cyan: cyan().into(),
|
cyan: cyan(),
|
||||||
teal: teal().into(),
|
teal: teal(),
|
||||||
jade: jade().into(),
|
jade: jade(),
|
||||||
green: green().into(),
|
green: green(),
|
||||||
grass: grass().into(),
|
grass: grass(),
|
||||||
lime: lime().into(),
|
lime: lime(),
|
||||||
mint: mint().into(),
|
mint: mint(),
|
||||||
sky: sky().into(),
|
sky: sky(),
|
||||||
black: black().into(),
|
black: black(),
|
||||||
white: white().into(),
|
white: white(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gray() -> DefaultColorScaleSet {
|
fn gray() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Gray",
|
scale: "Gray",
|
||||||
light: [
|
light: [
|
||||||
|
@ -428,9 +428,10 @@ fn gray() -> DefaultColorScaleSet {
|
||||||
"#ffffffed",
|
"#ffffffed",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mauve() -> DefaultColorScaleSet {
|
fn mauve() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Mauve",
|
scale: "Mauve",
|
||||||
light: [
|
light: [
|
||||||
|
@ -490,9 +491,10 @@ fn mauve() -> DefaultColorScaleSet {
|
||||||
"#fdfdffef",
|
"#fdfdffef",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn slate() -> DefaultColorScaleSet {
|
fn slate() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Slate",
|
scale: "Slate",
|
||||||
light: [
|
light: [
|
||||||
|
@ -552,9 +554,10 @@ fn slate() -> DefaultColorScaleSet {
|
||||||
"#fcfdffef",
|
"#fcfdffef",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sage() -> DefaultColorScaleSet {
|
fn sage() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Sage",
|
scale: "Sage",
|
||||||
light: [
|
light: [
|
||||||
|
@ -614,9 +617,10 @@ fn sage() -> DefaultColorScaleSet {
|
||||||
"#fdfffeed",
|
"#fdfffeed",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn olive() -> DefaultColorScaleSet {
|
fn olive() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Olive",
|
scale: "Olive",
|
||||||
light: [
|
light: [
|
||||||
|
@ -676,9 +680,10 @@ fn olive() -> DefaultColorScaleSet {
|
||||||
"#fdfffded",
|
"#fdfffded",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sand() -> DefaultColorScaleSet {
|
fn sand() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Sand",
|
scale: "Sand",
|
||||||
light: [
|
light: [
|
||||||
|
@ -738,9 +743,10 @@ fn sand() -> DefaultColorScaleSet {
|
||||||
"#fffffded",
|
"#fffffded",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gold() -> DefaultColorScaleSet {
|
fn gold() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Gold",
|
scale: "Gold",
|
||||||
light: [
|
light: [
|
||||||
|
@ -800,9 +806,10 @@ fn gold() -> DefaultColorScaleSet {
|
||||||
"#fef7ede7",
|
"#fef7ede7",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bronze() -> DefaultColorScaleSet {
|
fn bronze() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Bronze",
|
scale: "Bronze",
|
||||||
light: [
|
light: [
|
||||||
|
@ -862,9 +869,10 @@ fn bronze() -> DefaultColorScaleSet {
|
||||||
"#fff1e9ec",
|
"#fff1e9ec",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn brown() -> DefaultColorScaleSet {
|
fn brown() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Brown",
|
scale: "Brown",
|
||||||
light: [
|
light: [
|
||||||
|
@ -924,9 +932,10 @@ fn brown() -> DefaultColorScaleSet {
|
||||||
"#feecd4f2",
|
"#feecd4f2",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn yellow() -> DefaultColorScaleSet {
|
fn yellow() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Yellow",
|
scale: "Yellow",
|
||||||
light: [
|
light: [
|
||||||
|
@ -986,9 +995,10 @@ fn yellow() -> DefaultColorScaleSet {
|
||||||
"#fef6baf6",
|
"#fef6baf6",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn amber() -> DefaultColorScaleSet {
|
fn amber() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Amber",
|
scale: "Amber",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1048,9 +1058,10 @@ fn amber() -> DefaultColorScaleSet {
|
||||||
"#ffe7b3ff",
|
"#ffe7b3ff",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn orange() -> DefaultColorScaleSet {
|
fn orange() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Orange",
|
scale: "Orange",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1110,9 +1121,10 @@ fn orange() -> DefaultColorScaleSet {
|
||||||
"#ffe0c2ff",
|
"#ffe0c2ff",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tomato() -> DefaultColorScaleSet {
|
fn tomato() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Tomato",
|
scale: "Tomato",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1172,9 +1184,10 @@ fn tomato() -> DefaultColorScaleSet {
|
||||||
"#ffd6cefb",
|
"#ffd6cefb",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn red() -> DefaultColorScaleSet {
|
fn red() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Red",
|
scale: "Red",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1234,9 +1247,10 @@ fn red() -> DefaultColorScaleSet {
|
||||||
"#ffd1d9ff",
|
"#ffd1d9ff",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ruby() -> DefaultColorScaleSet {
|
fn ruby() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Ruby",
|
scale: "Ruby",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1296,9 +1310,10 @@ fn ruby() -> DefaultColorScaleSet {
|
||||||
"#ffd3e2fe",
|
"#ffd3e2fe",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn crimson() -> DefaultColorScaleSet {
|
fn crimson() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Crimson",
|
scale: "Crimson",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1358,9 +1373,10 @@ fn crimson() -> DefaultColorScaleSet {
|
||||||
"#ffd5eafd",
|
"#ffd5eafd",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pink() -> DefaultColorScaleSet {
|
fn pink() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Pink",
|
scale: "Pink",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1420,9 +1436,10 @@ fn pink() -> DefaultColorScaleSet {
|
||||||
"#ffd3ecfd",
|
"#ffd3ecfd",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn plum() -> DefaultColorScaleSet {
|
fn plum() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Plum",
|
scale: "Plum",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1482,9 +1499,10 @@ fn plum() -> DefaultColorScaleSet {
|
||||||
"#feddfef4",
|
"#feddfef4",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn purple() -> DefaultColorScaleSet {
|
fn purple() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Purple",
|
scale: "Purple",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1544,9 +1562,10 @@ fn purple() -> DefaultColorScaleSet {
|
||||||
"#f1ddfffa",
|
"#f1ddfffa",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn violet() -> DefaultColorScaleSet {
|
fn violet() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Violet",
|
scale: "Violet",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1606,9 +1625,10 @@ fn violet() -> DefaultColorScaleSet {
|
||||||
"#e3defffe",
|
"#e3defffe",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn iris() -> DefaultColorScaleSet {
|
fn iris() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Iris",
|
scale: "Iris",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1668,9 +1688,10 @@ fn iris() -> DefaultColorScaleSet {
|
||||||
"#e1e0fffe",
|
"#e1e0fffe",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn indigo() -> DefaultColorScaleSet {
|
fn indigo() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Indigo",
|
scale: "Indigo",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1730,9 +1751,10 @@ fn indigo() -> DefaultColorScaleSet {
|
||||||
"#d6e1ffff",
|
"#d6e1ffff",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn blue() -> DefaultColorScaleSet {
|
fn blue() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Blue",
|
scale: "Blue",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1792,9 +1814,10 @@ fn blue() -> DefaultColorScaleSet {
|
||||||
"#c2e6ffff",
|
"#c2e6ffff",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn cyan() -> DefaultColorScaleSet {
|
fn cyan() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Cyan",
|
scale: "Cyan",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1854,9 +1877,10 @@ fn cyan() -> DefaultColorScaleSet {
|
||||||
"#bbf3fef7",
|
"#bbf3fef7",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn teal() -> DefaultColorScaleSet {
|
fn teal() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Teal",
|
scale: "Teal",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1916,9 +1940,10 @@ fn teal() -> DefaultColorScaleSet {
|
||||||
"#b8ffebef",
|
"#b8ffebef",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn jade() -> DefaultColorScaleSet {
|
fn jade() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Jade",
|
scale: "Jade",
|
||||||
light: [
|
light: [
|
||||||
|
@ -1978,9 +2003,10 @@ fn jade() -> DefaultColorScaleSet {
|
||||||
"#b8ffe1ef",
|
"#b8ffe1ef",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn green() -> DefaultColorScaleSet {
|
fn green() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Green",
|
scale: "Green",
|
||||||
light: [
|
light: [
|
||||||
|
@ -2040,9 +2066,10 @@ fn green() -> DefaultColorScaleSet {
|
||||||
"#bbffd7f0",
|
"#bbffd7f0",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn grass() -> DefaultColorScaleSet {
|
fn grass() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Grass",
|
scale: "Grass",
|
||||||
light: [
|
light: [
|
||||||
|
@ -2102,9 +2129,10 @@ fn grass() -> DefaultColorScaleSet {
|
||||||
"#ceffceef",
|
"#ceffceef",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lime() -> DefaultColorScaleSet {
|
fn lime() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Lime",
|
scale: "Lime",
|
||||||
light: [
|
light: [
|
||||||
|
@ -2164,9 +2192,10 @@ fn lime() -> DefaultColorScaleSet {
|
||||||
"#e9febff7",
|
"#e9febff7",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mint() -> DefaultColorScaleSet {
|
fn mint() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Mint",
|
scale: "Mint",
|
||||||
light: [
|
light: [
|
||||||
|
@ -2226,9 +2255,10 @@ fn mint() -> DefaultColorScaleSet {
|
||||||
"#cbfee9f5",
|
"#cbfee9f5",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sky() -> DefaultColorScaleSet {
|
fn sky() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Sky",
|
scale: "Sky",
|
||||||
light: [
|
light: [
|
||||||
|
@ -2288,9 +2318,10 @@ fn sky() -> DefaultColorScaleSet {
|
||||||
"#c2f3ffff",
|
"#c2f3ffff",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn black() -> DefaultColorScaleSet {
|
fn black() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "Black",
|
scale: "Black",
|
||||||
light: [
|
light: [
|
||||||
|
@ -2350,9 +2381,10 @@ fn black() -> DefaultColorScaleSet {
|
||||||
"#000000f2",
|
"#000000f2",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn white() -> DefaultColorScaleSet {
|
fn white() -> ColorScaleSet {
|
||||||
DefaultColorScaleSet {
|
DefaultColorScaleSet {
|
||||||
scale: "White",
|
scale: "White",
|
||||||
light: [
|
light: [
|
||||||
|
@ -2412,4 +2444,5 @@ fn white() -> DefaultColorScaleSet {
|
||||||
"#fffffff2",
|
"#fffffff2",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue