About Color

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

About Color

garduino
Hi:

Certainly I do not know much about colours, rgb, hcl et all and I can't understand how is that in Cuis the values of rgb (or hcl) admit float values (0.0 to 1.0) and in any web conversion utility only integers are accepted.
 
Any explanation will be appreciated.

Thanks for the help. 

--
Saludos / Regards,
Germán Arduino
www.arduinosoftware.com

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: About Color

Frank Shearar-3
On 13 August 2013 15:41, Germán Arduino <[hidden email]> wrote:
> Hi:
>
> Certainly I do not know much about colours, rgb, hcl et all and I can't
> understand how is that in Cuis the values of rgb (or hcl) admit float values
> (0.0 to 1.0) and in any web conversion utility only integers are accepted.
>
> Any explanation will be appreciated.

Unless Cuis's Color has radically drifted from Squeak's Color, you can
consider the float range to be a remapping of the integer range
0..255, indicating the amount of that colour. So primary red, #ff0000,
is Color r: 1.0 g: 0.0 b: 0.0. In other words, 1.0 means "as much red
as possible" and 0.0 means "no red at all" while 0.5 means "half the
possible amount of red".

On the other hand, Color r: 0.5 g: 0.5 b: 0.5 is #7f7f7f because (0.5
* 255) asInteger printStringHex = '7F'.

(I might well be committing an off-by-one error in the above, because
I vaguely recall Juan talking about this a few months ago).

frank

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: About Color

Angel Java Lopez
I see 0..255 range as an humankind history accident

Float range from 0.0 to 1.0 are forever, or at least, while we have a color expressed as red, green, blue

Program for the Enterprise (Star Trek) software



On Tue, Aug 13, 2013 at 2:25 PM, Frank Shearar <[hidden email]> wrote:
On 13 August 2013 15:41, Germán Arduino <[hidden email]> wrote:
> Hi:
>
> Certainly I do not know much about colours, rgb, hcl et all and I can't
> understand how is that in Cuis the values of rgb (or hcl) admit float values
> (0.0 to 1.0) and in any web conversion utility only integers are accepted.
>
> Any explanation will be appreciated.

Unless Cuis's Color has radically drifted from Squeak's Color, you can
consider the float range to be a remapping of the integer range
0..255, indicating the amount of that colour. So primary red, #ff0000,
is Color r: 1.0 g: 0.0 b: 0.0. In other words, 1.0 means "as much red
as possible" and 0.0 means "no red at all" while 0.5 means "half the
possible amount of red".

On the other hand, Color r: 0.5 g: 0.5 b: 0.5 is #7f7f7f because (0.5
* 255) asInteger printStringHex = '7F'.

(I might well be committing an off-by-one error in the above, because
I vaguely recall Juan talking about this a few months ago).

frank

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: About Color

garduino
In reply to this post by Frank Shearar-3
ok, clear enough, thanks Frank and Angel.

Seems that then I can't test a color used in Cuis with most of online tools....but now I'm checking the examples in Color class in Cuis to try inside Cuis.

Thanks!


2013/8/13 Frank Shearar <[hidden email]>
On 13 August 2013 15:41, Germán Arduino <[hidden email]> wrote:
> Hi:
>
> Certainly I do not know much about colours, rgb, hcl et all and I can't
> understand how is that in Cuis the values of rgb (or hcl) admit float values
> (0.0 to 1.0) and in any web conversion utility only integers are accepted.
>
> Any explanation will be appreciated.

Unless Cuis's Color has radically drifted from Squeak's Color, you can
consider the float range to be a remapping of the integer range
0..255, indicating the amount of that colour. So primary red, #ff0000,
is Color r: 1.0 g: 0.0 b: 0.0. In other words, 1.0 means "as much red
as possible" and 0.0 means "no red at all" while 0.5 means "half the
possible amount of red".

On the other hand, Color r: 0.5 g: 0.5 b: 0.5 is #7f7f7f because (0.5
* 255) asInteger printStringHex = '7F'.

(I might well be committing an off-by-one error in the above, because
I vaguely recall Juan talking about this a few months ago).

frank

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org



--
Saludos / Regards,
Germán Arduino
www.arduinosoftware.com

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: About Color

Douglas Brebner
On 13/08/2013 19:26, Germán Arduino wrote:

Seems that then I can't test a color used in Cuis with most of online tools....but now I'm checking the examples in Color class in Cuis to try inside Cuis.

One other thing I haven't seen mentioned is that float colours will continue to work completely correctly if Cuis gains the ability to handle 16 bit per channel images. Or any other types of RGB images for that matter. e.g. Scans and digital camera raw formats can have some really odd bit depths.

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: About Color

Frank Shearar-3
In reply to this post by garduino
Is there an #asHTMLColor selector?

On 13 August 2013 19:26, Germán Arduino <[hidden email]> wrote:

> ok, clear enough, thanks Frank and Angel.
>
> Seems that then I can't test a color used in Cuis with most of online
> tools....but now I'm checking the examples in Color class in Cuis to try
> inside Cuis.
>
> Thanks!
>
>
> 2013/8/13 Frank Shearar <[hidden email]>
>>
>> On 13 August 2013 15:41, Germán Arduino <[hidden email]> wrote:
>> > Hi:
>> >
>> > Certainly I do not know much about colours, rgb, hcl et all and I can't
>> > understand how is that in Cuis the values of rgb (or hcl) admit float
>> > values
>> > (0.0 to 1.0) and in any web conversion utility only integers are
>> > accepted.
>> >
>> > Any explanation will be appreciated.
>>
>> Unless Cuis's Color has radically drifted from Squeak's Color, you can
>> consider the float range to be a remapping of the integer range
>> 0..255, indicating the amount of that colour. So primary red, #ff0000,
>> is Color r: 1.0 g: 0.0 b: 0.0. In other words, 1.0 means "as much red
>> as possible" and 0.0 means "no red at all" while 0.5 means "half the
>> possible amount of red".
>>
>> On the other hand, Color r: 0.5 g: 0.5 b: 0.5 is #7f7f7f because (0.5
>> * 255) asInteger printStringHex = '7F'.
>>
>> (I might well be committing an off-by-one error in the above, because
>> I vaguely recall Juan talking about this a few months ago).
>>
>> frank
>>
>> _______________________________________________
>> Cuis mailing list
>> [hidden email]
>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>
>
>
>
> --
> Saludos / Regards,
> Germán Arduino
> www.arduinosoftware.com
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: About Color

Casey Ransberger-2
Not sure. Maybe look at #pixelValueForDepth: ?

I could actually see some use for something like #rInt:gInt:bInt:aInt (mostly for dealing with the marketing or ad sales teams. OTOH, these are the same people who once asked us to move the logo over to the left four and a third pixels, so who knows *shrug.*)


On Tue, Aug 13, 2013 at 12:01 PM, Frank Shearar <[hidden email]> wrote:
Is there an #asHTMLColor selector?

On 13 August 2013 19:26, Germán Arduino <[hidden email]> wrote:
> ok, clear enough, thanks Frank and Angel.
>
> Seems that then I can't test a color used in Cuis with most of online
> tools....but now I'm checking the examples in Color class in Cuis to try
> inside Cuis.
>
> Thanks!
>
>
> 2013/8/13 Frank Shearar <[hidden email]>
>>
>> On 13 August 2013 15:41, Germán Arduino <[hidden email]> wrote:
>> > Hi:
>> >
>> > Certainly I do not know much about colours, rgb, hcl et all and I can't
>> > understand how is that in Cuis the values of rgb (or hcl) admit float
>> > values
>> > (0.0 to 1.0) and in any web conversion utility only integers are
>> > accepted.
>> >
>> > Any explanation will be appreciated.
>>
>> Unless Cuis's Color has radically drifted from Squeak's Color, you can
>> consider the float range to be a remapping of the integer range
>> 0..255, indicating the amount of that colour. So primary red, #ff0000,
>> is Color r: 1.0 g: 0.0 b: 0.0. In other words, 1.0 means "as much red
>> as possible" and 0.0 means "no red at all" while 0.5 means "half the
>> possible amount of red".
>>
>> On the other hand, Color r: 0.5 g: 0.5 b: 0.5 is #7f7f7f because (0.5
>> * 255) asInteger printStringHex = '7F'.
>>
>> (I might well be committing an off-by-one error in the above, because
>> I vaguely recall Juan talking about this a few months ago).
>>
>> frank
>>
>> _______________________________________________
>> Cuis mailing list
>> [hidden email]
>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>
>
>
>
> --
> Saludos / Regards,
> Germán Arduino
> www.arduinosoftware.com
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org



--
Casey Ransberger

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: About Color

KenDickey
On Tue, 13 Aug 2013 13:05:03 -0700
Casey Ransberger <[hidden email]> wrote:

> Not sure. Maybe look at #pixelValueForDepth: ?
>
> I could actually see some use for something like #rInt:gInt:bInt:aInt
> (mostly for dealing with the marketing or ad sales teams. OTOH, these are
> the same people who once asked us to move the logo over to the left four
> and a third pixels, so who knows *shrug.*)

Useful to look at   Color Class>>fromString:

Note lines like:
        red := ('16r', (aColorHexU copyFrom: 2 to: 3)) asNumber/255.

So:
        (((Color fromString: '#5edc1f') red) * 255) truncated hex.
                ==> '16r5E'
Likewise for #green and #blue.

So now you can write a Color instance method that returns the hex R G and B values in 0..255, yes?

Cheers,
Ken [dot] Dickey [at] whidbey [dot] com

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: About Color

Juan Vuletich-4
In reply to this post by garduino
Hi Germán,

I hope the help folks already gave was useful. In any case, what do you mean by 'testing a Cuis color with an online tool'?

Don't hesitate to keep asking :)

Cheers,
Juan Vuletich

On 8/13/2013 3:26 PM, Germán Arduino wrote:
ok, clear enough, thanks Frank and Angel.

Seems that then I can't test a color used in Cuis with most of online tools....but now I'm checking the examples in Color class in Cuis to try inside Cuis.

Thanks!


2013/8/13 Frank Shearar <[hidden email]>
On 13 August 2013 15:41, Germán Arduino <[hidden email]> wrote:
> Hi:
>
> Certainly I do not know much about colours, rgb, hcl et all and I can't
> understand how is that in Cuis the values of rgb (or hcl) admit float values
> (0.0 to 1.0) and in any web conversion utility only integers are accepted.
>
> Any explanation will be appreciated.

Unless Cuis's Color has radically drifted from Squeak's Color, you can
consider the float range to be a remapping of the integer range
0..255, indicating the amount of that colour. So primary red, #ff0000,
is Color r: 1.0 g: 0.0 b: 0.0. In other words, 1.0 means "as much red
as possible" and 0.0 means "no red at all" while 0.5 means "half the
possible amount of red".

On the other hand, Color r: 0.5 g: 0.5 b: 0.5 is #7f7f7f because (0.5
* 255) asInteger printStringHex = '7F'.

(I might well be committing an off-by-one error in the above, because
I vaguely recall Juan talking about this a few months ago).

frank

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org



--
Saludos / Regards,
Germán Arduino
www.arduinosoftware.com
_______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: About Color

garduino



2013/8/13 Juan Vuletich <[hidden email]>

I hope the help folks already gave was useful.

Yes, Indeed!
 
In any case, what do you mean by 'testing a Cuis color with an online tool'?


I meant, for example, use a tool as this one http://html-color-codes.info/codigos-de-colores-hexadecimales/ [*] to quickly test rgb and hcl, BUT antismalltalker me!! I can do it easily in Cuis :)
 
[*] Here you can use only integers.

Cheers!

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: About Color

KenDickey
By the way, you might be interested in named colors.

You can get the closest named color to an arbitrary color.

The CSS3 color names are useful in Web work.

  Feature require: 'CSS3-NamedColors'.
  Color setColorNamesDict: (Color css3ColorDictionary).
  (Color fromString: '#5edc1f') closestColorName. "-->  #lawnGreen"


Cheers!
--
Ken [dot] Dickey [at] whidbey [dot] com

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
-KenD
Reply | Threaded
Open this post in threaded view
|

Re: About Color

garduino
ahhh yes!

Thanks Ken!


2013/8/15 Ken Dickey <[hidden email]>
By the way, you might be interested in named colors.

You can get the closest named color to an arbitrary color.

The CSS3 color names are useful in Web work.

  Feature require: 'CSS3-NamedColors'.
  Color setColorNamesDict: (Color css3ColorDictionary).
  (Color fromString: '#5edc1f') closestColorName. "-->  #lawnGreen"


Cheers!
--
Ken [dot] Dickey [at] whidbey [dot] com

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org



--
Saludos / Regards,
Germán Arduino
www.arduinosoftware.com

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org