Skip to content

Commit

Permalink
feat: add hexa color space
Browse files Browse the repository at this point in the history
  • Loading branch information
JiatLn committed Aug 30, 2023
1 parent 1760bb9 commit 7b72b22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/color_space/color_space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ pub enum ColorSpace {
///
/// HSV stands for hue, saturation, and value.
HSV,
/// Hex color space.
///
/// Hex stands for hexadecimal.
/// HEX stands for hexadecimal of `RGB`.
HEX,
/// HEXA stands for hexadecimal of `RGBA`.
HEXA,
/// HWB color space.
///
/// HWB stands for hue, whiteness, and blackness.
Expand Down Expand Up @@ -82,6 +82,7 @@ where
"hsla" => ColorSpace::HSLA,
"hsv" => ColorSpace::HSV,
"hex" => ColorSpace::HEX,
"hexa" => ColorSpace::HEXA,
"hwb" => ColorSpace::HWB,
"cmyk" => ColorSpace::CMYK,
"xyz" => ColorSpace::XYZ,
Expand All @@ -104,6 +105,7 @@ impl ColorSpace {
ColorSpace::HSLA => 4,
ColorSpace::HSV => 3,
ColorSpace::HEX => 3,
ColorSpace::HEXA => 4,
ColorSpace::HWB => 3,
ColorSpace::CMYK => 4,
ColorSpace::XYZ => 3,
Expand Down
2 changes: 1 addition & 1 deletion src/color_space/valid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl ColorSpace {
}
}
}
ColorSpace::HEX => todo!(
ColorSpace::HEX | ColorSpace::HEXA => todo!(
"HEX color space not implemented yet, please use `ColorSpace::valid_hex` instead"
),
ColorSpace::HWB => {
Expand Down

0 comments on commit 7b72b22

Please sign in to comment.