Opened 13 years ago

Last modified 9 years ago

#5475 closed enhancement

Eliminate ways of circumventing the Color constructor — at Version 4

Reported by: ptwobrussell Owned by: James Burke
Priority: low Milestone: 1.7
Component: Core Version: 1.0
Keywords: needsreview Cc: [email protected]
Blocked By: Blocking:

Description (last modified by bill)

From my read of Color.js, it seems like the API would benefit from eliminating the exposed dojo.colorFromRgb, dojo.colorFromHex, and dojo.colorFromArray functions and instead sticking them inside of the class itself. I'm sort of confused by the way that these methods allow you to circumvent the Color constructor itself, and I believe that the API would be a lot more crisp if you just used the Color constructor directly.

My recommendation is to tuck these methods inside of the Color class for Dojo 2.0.

If I've really missed something here (entirely possible) can you include a descriptive message which explains why these functions *should* be exposed, so that I can better present them in the book I'm writing -- because right now, I'm planning on skipping over them entirely for the reasons mentioned.

I don't know who else to assign to, so i looked at the revision log and noticed that elazutkin seems to be the maintainer, so I'll start there.

Change History (4)

comment:1 Changed 13 years ago by ptwobrussell

Actually, one more thing: I also don't understand the use case for why you'd pass a Color object to use the Color constructor to create a new Color object. Again, I'm intrigued and would love to know about an interesting use case for what seems like this "special" clone operation, but I really can't think of one or find one anywhere. Assuming you agree, perhaps this should be axed as well?

comment:2 Changed 13 years ago by Eugene Lazutkin

Owner: changed from Eugene Lazutkin to alex

I don't have an answer for this --- I was not the original author, so I preserved the existing API whne I did a clean up. I am reassigning it to Alex to make the call.

comment:3 Changed 13 years ago by alex

Milestone: 2.01.3

Milestone 2.0 deleted

comment:4 Changed 12 years ago by bill

Description: modified (diff)
Milestone: 1.32.0
Owner: changed from alex to James Burke
Note: See TracTickets for help on using tickets.