Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CMYK colors #155

Closed
mojavelinux opened this issue May 27, 2015 · 0 comments
Closed

Support CMYK colors #155

mojavelinux opened this issue May 27, 2015 · 0 comments
Assignees

Comments

@mojavelinux
Copy link
Member

Support CMYK colors in both the theme and the formatted text parser.

A CMYK color is specified as an array of 4 values in the theme.

Internally, Prawn treats CMYK values on a scale from 0 to 100. However, we want to conform to the (proposed) CSS spec, so we should convert the value accordingly.

If an individual value is greater than 1 or ends in %, then convert it to a number. If the value is 1 or less, then multiply it by 100.

Examples:

Percentage values:

base:
  font_color: [0, 0, 0, 80%]

or, using shorthand,

base:
  font_color: [0, 0, 0, 80]

Decimal values:

base:
  font_color: [0, 0, 0, 0.8]

Formatted text

When passing a theme color through a string of formatted text using the <color> element, we need to recognize a CMYK array and treat it appropriately.

For example:

<color rgb="[50, 100, 0, 0]">text</color>

Even though the attribute is rgb, the parser needs to recognize the CMYK value and preserve it.

@mojavelinux mojavelinux self-assigned this May 27, 2015
@mojavelinux mojavelinux added this to the v1.5.0 milestone May 27, 2015
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue May 27, 2015
- parse CMYK color values in theme
- parse CMYK color values in formatted text
- avoid redundant processing of color values when loading theme
- mixin color types into color values
- show example of CMYK value in default theme
- code formatting
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue May 27, 2015
- parse CMYK color values in theme
- parse CMYK color values in formatted text
- avoid redundant processing of color values when loading theme
- mixin color types into color values
- show example of CMYK value in default theme
- code formatting
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue May 27, 2015
- parse CMYK color values in theme
- parse CMYK color values in formatted text
- avoid redundant processing of color values when loading theme
- mixin color types into color values
- show example of CMYK value in default theme
- code formatting
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue May 27, 2015
- parse CMYK color values in theme
- parse CMYK color values in formatted text
- avoid redundant processing of color values when loading theme
- mixin color types into color values
- show example of CMYK value in default theme
- code formatting
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue May 27, 2015
- parse CMYK color values in theme
- parse CMYK color values in formatted text
- avoid redundant processing of color values when loading theme
- mixin color types into color values
- show example of CMYK value in default theme
- code formatting
mojavelinux added a commit that referenced this issue May 27, 2015
resolves #155 support CMYK color values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants