mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fix CMYK formatting
This commit is contained in:
parent
ed1197a3db
commit
6e198bf760
@ -229,7 +229,7 @@ impl CmykColor {
|
|||||||
|
|
||||||
impl Debug for CmykColor {
|
impl Debug for CmykColor {
|
||||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||||
let g = |c| c as f64 / 255.0;
|
let g = |c| 100.0 * (c as f64 / 255.0);
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"cmyk({:.1}%, {:.1}%, {:.1}%, {:.1}%)",
|
"cmyk({:.1}%, {:.1}%, {:.1}%, {:.1}%)",
|
||||||
|
@ -118,7 +118,8 @@ pub fn rgb(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
|
|||||||
},
|
},
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
/// Create an CMYK color.
|
|
||||||
|
/// Create a CMYK color.
|
||||||
pub fn cmyk(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
|
pub fn cmyk(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
|
||||||
struct Component(u8);
|
struct Component(u8);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user