Opened 12 years ago

Closed 10 years ago

#3879 closed enhancement (wontfix)

dojo.style should normalize colors

Reported by: sjmiles Owned by: sjmiles
Priority: high Milestone: future
Component: Core Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by sjmiles)

Colors in FF are returned as rgb(#,#,#) and #hex in IE. It seems natural that dojo.style should attempt to normalize these values.

Perhaps there is a function for this somewhere already?

Change History (9)

comment:1 Changed 12 years ago by sjmiles

Type: defectenhancement

comment:2 Changed 12 years ago by Adam Peller

You should be able to construct a dojo.Color with the string, then spit it back out using your choice of toHex or toCss. Only problem is that this will lose alpha information, as there's no x-browser way to represent that. If you're always dealing with rgb (no a), then you're ok.

comment:3 Changed 11 years ago by alex

Milestone: 1.01.1

comment:4 Changed 11 years ago by sjmiles

Milestone: 1.11.2

comment:5 Changed 11 years ago by sjmiles

Description: modified (diff)
Milestone: 1.21.2.1

comment:6 Changed 11 years ago by Adam Peller

Scott - we try to limit our dot release fixes to bug fixes and usually don't even have a milestone for this defined until after the major release goes out. In particular with an enhancement, we'd probably rather just see it land in 1.3 if it doesn't make 1.2.

comment:7 Changed 11 years ago by bill

Milestone: 1.2.11.3

1.2.1 is only for critical bugs that we find in the 1.2 release; nothing should be marked as 1.2.1 until after we release 1.2

comment:8 Changed 10 years ago by bill

Milestone: 1.3future

comment:9 in reply to:  2 Changed 10 years ago by Eugene Lazutkin

Resolution: wontfix
Status: newclosed

Replying to peller:

You should be able to construct a dojo.Color with the string, then spit it back out using your choice of toHex or toCss. Only problem is that this will lose alpha information, as there's no x-browser way to represent that. If you're always dealing with rgb (no a), then you're ok.

Color.js + dojo/colors.js work with alpha. Taking into account Adam's workaround I am closing this ticket.

Note: See TracTickets for help on using tickets.