Question about color

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

Question about color

Offray
Hi,

At a local workshop we're working with the Pharo tutorial and we use the classical example of RGB colors for keyword messages. When we use the Prof Stef's example we get the following screenshot:



While executing the same color in Wolfram Alpha gives us:



As you can see, both colors are pretty different. Which is the reason behind the differences in the color that is shown in Pharo and the one in WA?

Cheers,

Offray
Reply | Threaded
Open this post in threaded view
|

Re: Question about color

Alejandro Infante
As far as I remember, Color>>#r:g:b: expects 3 numbers between 0 and 1, instead of integers from 0 to 255.

Inspecting a color using the fractions proposed by Wolframalpha gives you the expected color:
        Color
                r: 0.06
                g: 0.39
                b: 0.39

Cheers,
Alejandro

> On Sep 28, 2015, at 11:07 PM, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:
>
> Hi,
>
> At a local workshop we're working with the Pharo tutorial and we use the classical example of RGB colors for keyword messages. When we use the Prof Stef's example we get the following screenshot:
>
> <djjjjajg..png>
>
> While executing the same color in Wolfram Alpha gives us:
>
> <dgcdicbd..png>
>
> As you can see, both colors are pretty different. Which is the reason behind the differences in the color that is shown in Pharo and the one in WA?
>
> Cheers,
>
> Offray


Reply | Threaded
Open this post in threaded view
|

Re: Question about color

Offray
Thanks Alejandro. Mistery solved :-)

On 28/09/15 22:02, Alejandro Infante wrote:

> As far as I remember, Color>>#r:g:b: expects 3 numbers between 0 and 1, instead of integers from 0 to 255.
>
> Inspecting a color using the fractions proposed by Wolframalpha gives you the expected color:
> Color
> r: 0.06
> g: 0.39
> b: 0.39
>
> Cheers,
> Alejandro
>
>> On Sep 28, 2015, at 11:07 PM, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:
>>
>> Hi,
>>
>> At a local workshop we're working with the Pharo tutorial and we use the classical example of RGB colors for keyword messages. When we use the Prof Stef's example we get the following screenshot:
>>
>> <djjjjajg..png>
>>
>> While executing the same color in Wolfram Alpha gives us:
>>
>> <dgcdicbd..png>
>>
>> As you can see, both colors are pretty different. Which is the reason behind the differences in the color that is shown in Pharo and the one in WA?
>>
>> Cheers,
>>
>> Offray
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Question about color

Ben Coman
In reply to this post by Alejandro Infante
This must be a common user error.  Should the method actually error
when passed a number > 1 ?
cheers -ben

On Tue, Sep 29, 2015 at 11:02 AM, Alejandro Infante
<[hidden email]> wrote:

> As far as I remember, Color>>#r:g:b: expects 3 numbers between 0 and 1, instead of integers from 0 to 255.
>
> Inspecting a color using the fractions proposed by Wolframalpha gives you the expected color:
>         Color
>                 r: 0.06
>                 g: 0.39
>                 b: 0.39
>
> Cheers,
> Alejandro
>
>> On Sep 28, 2015, at 11:07 PM, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:
>>
>> Hi,
>>
>> At a local workshop we're working with the Pharo tutorial and we use the classical example of RGB colors for keyword messages. When we use the Prof Stef's example we get the following screenshot:
>>
>> <djjjjajg..png>
>>
>> While executing the same color in Wolfram Alpha gives us:
>>
>> <dgcdicbd..png>
>>
>> As you can see, both colors are pretty different. Which is the reason behind the differences in the color that is shown in Pharo and the one in WA?
>>
>> Cheers,
>>
>> Offray
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Question about color

Esteban A. Maringolo
2015-09-29 10:08 GMT-03:00 Ben Coman <[hidden email]>:
>
> This must be a common user error.  Should the method actually error
> when passed a number > 1 ?
> cheers -ben

+1

"Rule of repair: When you must fail, fail noisily and as soon as possible" :)



Esteban A. Maringolo