DaveS
(DaveS)
October 16, 2019, 5:44pm
1
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 shouldnt take more than a minute to find out yourself
MarkusR
(MarkusR)
October 16, 2019, 7:02pm
3
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
DaveS
(DaveS)
October 16, 2019, 7:31pm
5
[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
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