Bug 176811 - Web Inspector: Color created from an RGB/HSL triplet returns bad component arrays
Summary: Web Inspector: Color created from an RGB/HSL triplet returns bad component ar...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks: 176822
  Show dependency treegraph
 
Reported: 2017-09-12 15:09 PDT by Matt Baker
Modified: 2017-09-14 15:01 PDT (History)
4 users (show)

See Also:


Attachments
Patch (8.80 KB, patch)
2017-09-12 15:21 PDT, Matt Baker
no flags Details | Formatted Diff | Diff
Patch (10.39 KB, patch)
2017-09-12 15:23 PDT, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2017-09-12 15:09:40 PDT
Summary:
Color created from an RGB/HSL triplet returns bad component arrays.

For example:

> color = new WI.Color(WI.Color.Format.RGB, [255, 0, 0])
> color.rgb
< [255, 0]

> color.rgba
< [255, 0, 0]

The results from storing the triplet in either `_rgba` or `_hsla`, which are both assumed to have a length of four.

The problem also causes unexpected results when converting a Color created from components to a string:

> color.toString()
< "rgba(255, 0, 0)"

> color.toString(WebInspector.Color.Format.ShortHEX)
< "rgba(255, 0, 0)"

We should be able to convert a Color created from components just as easily as one created using `fromString()`.
Comment 1 Radar WebKit Bug Importer 2017-09-12 15:10:34 PDT
<rdar://problem/34397529>
Comment 2 Matt Baker 2017-09-12 15:21:10 PDT
Created attachment 320571 [details]
Patch
Comment 3 Matt Baker 2017-09-12 15:23:44 PDT
Created attachment 320572 [details]
Patch
Comment 4 Joseph Pecoraro 2017-09-14 14:32:18 PDT
Comment on attachment 320572 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2017-09-14 15:01:29 PDT
Comment on attachment 320572 [details]
Patch

Clearing flags on attachment: 320572

Committed r222055: <http://trac.webkit.org/changeset/222055>
Comment 6 WebKit Commit Bot 2017-09-14 15:01:30 PDT
All reviewed patches have been landed.  Closing bug.