Merge branch 'cosmic-design-system' into sctk-cosmic-design-system
This commit is contained in:
commit
9796fa9f15
34 changed files with 850 additions and 1360 deletions
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright 2022 System76 <info@system76.com>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
//TODO: GET CORRECT PALETTE FROM COSMIC-THEME
|
||||
use iced_core::Color;
|
||||
|
||||
|
|
@ -85,6 +88,7 @@ lazy_static! {
|
|||
}
|
||||
|
||||
impl Extended {
|
||||
#[must_use]
|
||||
pub fn generate(palette: Palette) -> Self {
|
||||
Self {
|
||||
background: Background::new(palette.background, palette.text),
|
||||
|
|
@ -118,6 +122,7 @@ pub struct Background {
|
|||
}
|
||||
|
||||
impl Background {
|
||||
#[must_use]
|
||||
pub fn new(base: Color, text: Color) -> Self {
|
||||
let weak = mix(base, text, 0.15);
|
||||
let strong = mix(base, text, 0.40);
|
||||
|
|
@ -137,6 +142,7 @@ pub struct Primary {
|
|||
}
|
||||
|
||||
impl Primary {
|
||||
#[must_use]
|
||||
pub fn generate(base: Color, background: Color, text: Color) -> Self {
|
||||
let weak = mix(base, background, 0.4);
|
||||
let strong = deviate(base, 0.1);
|
||||
|
|
@ -156,6 +162,7 @@ pub struct Secondary {
|
|||
}
|
||||
|
||||
impl Secondary {
|
||||
#[must_use]
|
||||
pub fn generate(base: Color, text: Color) -> Self {
|
||||
let base = mix(base, text, 0.2);
|
||||
let weak = mix(base, text, 0.1);
|
||||
|
|
@ -176,6 +183,7 @@ pub struct Success {
|
|||
}
|
||||
|
||||
impl Success {
|
||||
#[must_use]
|
||||
pub fn generate(base: Color, background: Color, text: Color) -> Self {
|
||||
let weak = mix(base, background, 0.4);
|
||||
let strong = deviate(base, 0.1);
|
||||
|
|
@ -195,6 +203,7 @@ pub struct Danger {
|
|||
}
|
||||
|
||||
impl Danger {
|
||||
#[must_use]
|
||||
pub fn generate(base: Color, background: Color, text: Color) -> Self {
|
||||
let weak = mix(base, background, 0.4);
|
||||
let strong = deviate(base, 0.1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue