<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>221873</bug_id>
          
          <creation_ts>2021-02-13 19:54:28 -0800</creation_ts>
          <short_desc>Add experimental support for CSS Color 5 color transformations</short_desc>
          <delta_ts>2021-11-26 10:57:00 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>221880</dependson>
    
    <dependson>222258</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sam Weinig">sam</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
    
    <cc>koivisto</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1728973</commentid>
    <comment_count>0</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-02-13 19:54:28 -0800</bug_when>
    <thetext>Now that we have adequate support for static color types and CSS Color 4, we should look at adding experimental support for the color transformation functions and syntax of CSS Color 5 - https://drafts.csswg.org/css-color-5/.

From doing an initial look, I have spotted a few initial things that we will need to consider:

- How should we handle transformations of color keywords that are currently not resolved until something like colorFromPrimitiveValue is called? The most basic example would be doing something like `color-mix(lch currentColor 40%, red)`. My hunch is we will want to create a new CSSValue type to store these pending-colors (perhaps limited only to the cases we can&apos;t do them eagerly).

- How can we inject constants into the environment for calc()? For the relative color syntax, the spec seems to want injection of named constants into css calc() functions. For instance, one example includes the following:

    `color: hsl(from var(--accent) calc(h+180) s l);`

In this example, the &quot;h&quot; should be numeric value of the hue channel of var(--accent) converted to HSL. We will have to see what the best way to model this in the current CSS calc infrastructure is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1731903</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-02-20 19:55:11 -0800</bug_when>
    <thetext>&lt;rdar://problem/74562173&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1817982</commentid>
    <comment_count>2</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2021-11-26 10:57:00 -0800</bug_when>
    <thetext>This is now complete.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>