Can I extend COLOR

is it possible to extend COLOR to add your own colors as if they were already there

for example… I can get RED (and various Xojo defined colors)

c=COLOR.RED

I want to add a specific list of custom colors, to so I can use the same type syntax in my code

c=COLOR.rosyBlue

It shouldn’t take more than a minute to find out yourself … :wink:

in r2 extends did not really work, it do not list the Methods at auto complete but is was possible to use.

[code]Public Function Rosa(Extends col as Color) as Color
Return &cFF808000

End Function
[/code]

not what you want but the simplest was a new class with constants type color .

you cannot add methods to an existing namespace - which is what Color is

I think there is a feature request for this but it hasnt been implemented

[quote=458784:@Markus Rauch]in r2 extends did not really work, it do not list the Methods at auto complete but is was possible to use.

Public Function Rosa(Extends col as Color) as Color Return &cFF808000 End Function
not what you want but the simplest was a new class with constants type color .[/quote]

that is what I THOUGHT the answer would be… but Norman and Tim are correct…

So for now I’m just going to define constants

Or forget extending and create a helper class full of color constants.

ColorPalette for non-Brazilians :slight_smile:

Nope. For all. My impulse for “double the consonant” touched the wrong place and I only noticed it now.

Such impulse came from the portuguese word “Palheta” in mind instead of “Paleta”. In PT-BR it would be Paleta.Fucsia, Paleta.Lima