Closed
Bug 515919
Opened 15 years ago
Closed 1 year ago
style system should store colors allowing larger gamut (and more precision)
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
People
(Reporter: dbaron, Unassigned)
References
(Depends on 2 open bugs)
Details
The style system should store colors as floats (rather than clamping to sRGB at parse time) for three reasons:
1. when we do full-page color management, some of the outside-sRGB colors will be representable
2. animations between colors should clamp at the correct point
3. additive animations (SMIL) should function for negative color components
When we do this we should fix the FIXME comment in
http://hg.mozilla.org/mozilla-central/rev/e98277a9cec4
Reporter | ||
Comment 1•15 years ago
|
||
I just discussed this with vlad; I think we settled on the idea that it would make more sense (space-wise) to use something like signed 4.12 fixed point (treating sRGB as being 0-1), so that a single color value would fit in 64 bits.
(If we used gfxRGBA, it would be 256 bits; if we used a similar structure that had floats instead of doubles, it would be 128 bits.)
I think that would address all the practical cases here (and potentially allow feeding more precision to cairo if it ever supports that additional precision on the other end, although not the full 16-bits-per-component precision).
Summary: style system should store colors as floats → style system should store colors allowing larger gamut (and more precision)
Reporter | ||
Comment 2•8 years ago
|
||
Actually, I think changes in css-color-4 make this mostly invalid, since colors are now supposed to be clamped to 0-255, but we should implement the new stuff that replaces it.
Comment 3•8 years ago
|
||
Are we still going to use real numbers for colors? Would that affect how complex color for interpolation should look like?
Flags: needinfo?(dbaron)
Reporter | ||
Comment 4•8 years ago
|
||
There probably still is value in using higher precision to represent fractional values within 0-255, although I suspect fixed point may be preferable to floats. I'm not sure what you mean about complex color and interpolation.
Flags: needinfo?(dbaron)
Updated•2 years ago
|
Severity: normal → S3
Comment 5•1 year ago
|
||
The [css-color-4] spec was implemented along with gamut mapping, so closing this issue as we now have float value colors.
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•