Re: color lib

2016-10-11 Thread Andrea Fontana via Digitalmars-d
On Tuesday, 11 October 2016 at 12:14:37 UTC, Manu wrote: Oh dear... thanks for digging that up. I didn't know the web had a standard for alpha. Certainly 0xAARRGGBB has been used in windows code for as long as I've been programming... but now there's a competing #RRGGBBAA version... How to

Re: color lib

2016-10-11 Thread Manu via Digitalmars-d
On 11 October 2016 at 18:10, Andrea Fontana via Digitalmars-d wrote: > On Monday, 10 October 2016 at 23:26:53 UTC, Manu wrote: >> >> I'm not sure why it matters what format the colour you have is... >> Strings are in the form #RRGGBB, or #AARRGGBB. That is all. >>

Re: color lib

2016-10-11 Thread Andrea Fontana via Digitalmars-d
On Monday, 10 October 2016 at 23:26:53 UTC, Manu wrote: I'm not sure why it matters what format the colour you have is... Strings are in the form #RRGGBB, or #AARRGGBB. That is all. It's the standard I've seen used everywhere ever, including the web, which is a pretty good precedent :P If

Re: color lib

2016-10-10 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 11 October 2016 at 00:10:04 UTC, Nicholas Wilson wrote: What about forwarding the array ops to a foreach of the static array? Like as above but instead of: ElementType!(R)[N] batch; have: static struct Batch { ElementType!(R)[N] elements; auto get() { return elements[];}

Re: color lib

2016-10-10 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 9 October 2016 at 13:28:05 UTC, Manu wrote: On 9 October 2016 at 15:34, Ilya Yaroshenko via Digitalmars-d wrote: On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d

Re: color lib

2016-10-10 Thread Manu via Digitalmars-d
On 10 October 2016 at 23:41, Andrea Fontana via Digitalmars-d wrote: > On Monday, 10 October 2016 at 13:25:07 UTC, Manu wrote: >> >> On 10 October 2016 at 23:00, Andrea Fontana via Digitalmars-d >> wrote: >>> >>> On Monday, 10 October

Re: color lib

2016-10-10 Thread Andrea Fontana via Digitalmars-d
On Monday, 10 October 2016 at 13:25:07 UTC, Manu wrote: On 10 October 2016 at 23:00, Andrea Fontana via Digitalmars-d wrote: On Monday, 10 October 2016 at 08:44:49 UTC, Manu wrote: From doc: colorFromString Create a color from a string. May be a hex color in the

Re: color lib

2016-10-10 Thread Manu via Digitalmars-d
On 10 October 2016 at 23:00, Andrea Fontana via Digitalmars-d wrote: > On Monday, 10 October 2016 at 08:44:49 UTC, Manu wrote: > > From doc: > colorFromString Create a color from a string. May be a hex color in the > standard forms: (#/$)rgb/argb/rrggbb/aarrggbb May

Re: color lib

2016-10-10 Thread Andrea Fontana via Digitalmars-d
On Monday, 10 October 2016 at 08:44:49 UTC, Manu wrote: On 10 October 2016 at 17:29, Andrea Fontana via Digitalmars-d wrote: On Thursday, 6 October 2016 at 14:53:52 UTC, Manu wrote: I've done another pass incorporating prior feedback, mostly focusing on

Re: color lib

2016-10-10 Thread Ethan Watson via Digitalmars-d
On Monday, 10 October 2016 at 12:10:56 UTC, Jacob Carlborg wrote: Isn't std.typecons.Flag metaprogramming ;) Hahaha, oh wow. If ever there was a case for mixins.

Re: color lib

2016-10-10 Thread Jacob Carlborg via Digitalmars-d
On 2016-10-10 12:39, Ethan Watson wrote: I'm especially trying to make Binderoo readable as there's so many programmers that are scared by metaprogramming. Isn't std.typecons.Flag metaprogramming ;) -- /Jacob Carlborg

Re: color lib

2016-10-10 Thread Ethan Watson via Digitalmars-d
On Saturday, 8 October 2016 at 13:06:42 UTC, Manu wrote: Oh no, you too? >_< Yeah, I've been going on a readability bender lately, especially in public facing code. My thinking there is that statements in code that don't immediately give context are essentially a cipher. Because that's

Re: color lib

2016-10-10 Thread Manu via Digitalmars-d
On 10 October 2016 at 17:29, Andrea Fontana via Digitalmars-d wrote: > On Thursday, 6 October 2016 at 14:53:52 UTC, Manu wrote: >> >> I've done another pass incorporating prior feedback, mostly focusing on >> documentation. >> >> >>

Re: color lib

2016-10-10 Thread Andrea Fontana via Digitalmars-d
On Thursday, 6 October 2016 at 14:53:52 UTC, Manu wrote: I've done another pass incorporating prior feedback, mostly focusing on documentation.

Re: color lib

2016-10-09 Thread Manu via Digitalmars-d
On 9 October 2016 at 23:36, Ilya Yaroshenko via Digitalmars-d wrote: > On Sunday, 9 October 2016 at 13:18:22 UTC, Manu wrote: >> >> On 9 October 2016 at 15:34, Ilya Yaroshenko via Digitalmars-d >> wrote: >>> >>> On Sunday, 9 October 2016

Re: color lib

2016-10-09 Thread Ilya Yaroshenko via Digitalmars-d
On Sunday, 9 October 2016 at 13:18:22 UTC, Manu wrote: On 9 October 2016 at 15:34, Ilya Yaroshenko via Digitalmars-d wrote: On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d

Re: color lib

2016-10-09 Thread Manu via Digitalmars-d
On 9 October 2016 at 18:39, Nicholas Wilson via Digitalmars-d wrote: > On Sunday, 9 October 2016 at 05:34:06 UTC, Ilya Yaroshenko wrote: >> >> On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: >>> >>> On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d

Re: color lib

2016-10-09 Thread Manu via Digitalmars-d
On 9 October 2016 at 18:25, Nicholas Wilson via Digitalmars-d wrote: > On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: >> >> On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d >> wrote: >>> >>> How far would

Re: color lib

2016-10-09 Thread Manu via Digitalmars-d
On 9 October 2016 at 15:34, Ilya Yaroshenko via Digitalmars-d wrote: > On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: >> >> On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d >> wrote: >>> >>> [...] >> >> >> Well the

Re: color lib

2016-10-09 Thread Manu via Digitalmars-d
On 9 October 2016 at 15:34, Ilya Yaroshenko via Digitalmars-d wrote: > On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: >> >> On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d >> wrote: >>> >>> [...] >> >> >> Well the

Re: color lib

2016-10-09 Thread Ilya Yaroshenko via Digitalmars-d
On Sunday, 9 October 2016 at 08:39:57 UTC, Nicholas Wilson wrote: On Sunday, 9 October 2016 at 05:34:06 UTC, Ilya Yaroshenko wrote: On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d wrote: [...]

Re: color lib

2016-10-09 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 9 October 2016 at 08:25:40 UTC, Nicholas Wilson wrote: How? All you need is an extra `each` e.g. r.inBatchesOf!(8).each!(a =>a[].map!(convertColor!RGBA8)) perhaps define a helper function for it that does each + the explicit slice + map, but it certainly doesn't scream completely

Re: color lib

2016-10-09 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 9 October 2016 at 05:34:06 UTC, Ilya Yaroshenko wrote: On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d wrote: [...] Well the trouble is the lambda that you might give to 'map' won't

Re: color lib

2016-10-09 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d wrote: How far would `r.inBatchesOf!(N)` go in terms of compiler optimisations (e.g. vectorisation) if N is a power of 2? auto inBatchesOf(size_t

Re: color lib

2016-10-08 Thread Ilya Yaroshenko via Digitalmars-d
On Sunday, 9 October 2016 at 05:21:32 UTC, Manu wrote: On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d wrote: [...] Well the trouble is the lambda that you might give to 'map' won't work anymore. Operators don't work on batches, you need to use a

Re: color lib

2016-10-08 Thread Manu via Digitalmars-d
On 9 October 2016 at 14:03, Nicholas Wilson via Digitalmars-d wrote: > On Saturday, 8 October 2016 at 13:06:42 UTC, Manu wrote: >> >> Oh no, you too? >_< >> Incidentally, have you had a geez over the core API? An efficient API >> will emerge when we work out how to

Re: color lib

2016-10-08 Thread Nicholas Wilson via Digitalmars-d
On Saturday, 8 October 2016 at 13:06:42 UTC, Manu wrote: Oh no, you too? >_< Incidentally, have you had a geez over the core API? An efficient API will emerge when we work out how to work batched operations into ranges... How far would `r.inBatchesOf!(N)` go in terms of compiler

Re: color lib

2016-10-08 Thread Manu via Digitalmars-d
On 8 October 2016 at 23:28, Ilya Yaroshenko via Digitalmars-d wrote: > On Saturday, 8 October 2016 at 13:06:42 UTC, Manu wrote: >> >> On 7 October 2016 at 18:09, Ethan Watson via Digitalmars-d >> wrote: >>> >>> On Friday, 7 October 2016

Re: color lib

2016-10-08 Thread Ilya Yaroshenko via Digitalmars-d
On Saturday, 8 October 2016 at 13:06:42 UTC, Manu wrote: On 7 October 2016 at 18:09, Ethan Watson via Digitalmars-d wrote: On Friday, 7 October 2016 at 01:57:06 UTC, Manu wrote: Regarding 'Linear.No'... yeah... I dunno. I've had this argument before. I really

Re: color lib

2016-10-08 Thread Manu via Digitalmars-d
On 7 October 2016 at 18:09, Ethan Watson via Digitalmars-d wrote: > On Friday, 7 October 2016 at 01:57:06 UTC, Manu wrote: >> >> Regarding 'Linear.No'... yeah... I dunno. I've had this argument before. >> I really hate that pattern. If it's required, I'll do it > > >

Re: color lib

2016-10-07 Thread Ethan Watson via Digitalmars-d
On Friday, 7 October 2016 at 01:57:06 UTC, Manu wrote: Regarding 'Linear.No'... yeah... I dunno. I've had this argument before. I really hate that pattern. If it's required, I'll do it At least as far as readability goes, explicit parameterisation lets you understand the invocation at a

Re: color lib

2016-10-07 Thread Ilya Yaroshenko via Digitalmars-d
On Friday, 7 October 2016 at 01:42:08 UTC, Manu wrote: On 7 October 2016 at 03:03, Ilya Yaroshenko via Digitalmars-d wrote: On Thursday, 6 October 2016 at 14:53:52 UTC, Manu wrote: [...] Could you please make `colorFromString` nothrow @nogc? Or make `nothrow

Re: color lib

2016-10-06 Thread Manu via Digitalmars-d
On 7 October 2016 at 12:55, Manu wrote: > On 7 October 2016 at 12:38, Manu wrote: >> On 7 October 2016 at 12:25, Chris Wright via Digitalmars-d >> wrote: >>> On Fri, 07 Oct 2016 11:42:08 +1000, Manu via Digitalmars-d wrote:

Re: color lib

2016-10-06 Thread Manu via Digitalmars-d
On 7 October 2016 at 12:38, Manu wrote: > On 7 October 2016 at 12:25, Chris Wright via Digitalmars-d > wrote: >> On Fri, 07 Oct 2016 11:42:08 +1000, Manu via Digitalmars-d wrote: >>> I think throwing is the precedented action in that failure

Re: color lib

2016-10-06 Thread Manu via Digitalmars-d
On 7 October 2016 at 12:25, Chris Wright via Digitalmars-d wrote: > On Fri, 07 Oct 2016 11:42:08 +1000, Manu via Digitalmars-d wrote: >> I think throwing is the precedented action in that failure case... >> what would you suggest? > > In C# 1.0, the standard pattern

Re: color lib

2016-10-06 Thread Manu via Digitalmars-d
On 7 October 2016 at 11:42, Manu wrote: > On 7 October 2016 at 03:03, Ilya Yaroshenko via Digitalmars-d > wrote: >> On Thursday, 6 October 2016 at 14:53:52 UTC, Manu wrote: >>> >>> I've done another pass incorporating prior feedback, mostly

Re: color lib

2016-10-06 Thread Chris Wright via Digitalmars-d
On Fri, 07 Oct 2016 11:42:08 +1000, Manu via Digitalmars-d wrote: > I think throwing is the precedented action in that failure case... > what would you suggest? In C# 1.0, the standard pattern was to throw on errors. Later, they revised their preferred mechanism and started offering methods

Re: color lib

2016-10-06 Thread Manu via Digitalmars-d
On 7 October 2016 at 04:48, Random D user via Digitalmars-d wrote: > On Thursday, 6 October 2016 at 14:53:52 UTC, Manu wrote: >> >> I've done another pass incorporating prior feedback, mostly focusing on >> documentation. > > > Just a quick minor comment on: > A8

Re: color lib

2016-10-06 Thread Manu via Digitalmars-d
On 7 October 2016 at 03:03, Ilya Yaroshenko via Digitalmars-d wrote: > On Thursday, 6 October 2016 at 14:53:52 UTC, Manu wrote: >> >> I've done another pass incorporating prior feedback, mostly focusing on >> documentation. >> >> >>

Re: color lib

2016-10-06 Thread Random D user via Digitalmars-d
On Thursday, 6 October 2016 at 14:53:52 UTC, Manu wrote: I've done another pass incorporating prior feedback, mostly focusing on documentation. Just a quick minor comment on: A8 RGB!("a",ubyte,false,0) 8 bit alpha-only color type. --> Reads like, "False what ???". Also "What is 0 ???". -->

Re: color lib

2016-10-06 Thread Ilya Yaroshenko via Digitalmars-d
On Thursday, 6 October 2016 at 14:53:52 UTC, Manu wrote: I've done another pass incorporating prior feedback, mostly focusing on documentation.

color lib

2016-10-06 Thread Manu via Digitalmars-d
I've done another pass incorporating prior feedback, mostly focusing on documentation. http://dtest.thecybershadow.net/artifact/website-b6e2e44dd40dd7c70eb45829c02060b99ae3937b-57272ccdf902fa3f0c050d522129f2be/web/library-prerelease/std/experimental/color.html Can interested parties please give