Jun 20, 2014 Replies: 7 It expands the colors (by name) to choose from when entering for eg Button1.colors = colorbyname.select-a-color. It includes the RGB option. Library files (colorbyname.xml, colorbyname.jar) are in the /files folder of the attached project. A bit less guessing of RGB values. Selection of colors are grouped into: White (including pastels) Grays Blues Greens Yellows Browns Oranges Pinks Attachments ColorByName.zip ColorByName.zip 13 KB · Views: 708 Last edited: Jun 29, 2014 Click to expand...
It expands the colors (by name) to choose from when entering for eg Button1.colors = colorbyname.select-a-color. It includes the RGB option. Library files (colorbyname.xml, colorbyname.jar) are in the /files folder of the attached project. A bit less guessing of RGB values. Selection of colors are grouped into: White (including pastels) Grays Blues Greens Yellows Browns Oranges Pinks
Derek Johnson Active Member Licensed User Longtime User Jul 29, 2015 #2 Do you have a version of this library for B4I please? Scratch that - just copied the XML and Jar files and it seems to work in B4I as is. Sorry - it only seemed to work. When entering code the intellisense feature worked but then it fails to compile saying a parameter is missing. I thought that because it was basically a list of constants I could get away with using the B4A library in B4I, but that is wrong! Derek Last edited: Jul 30, 2015
Do you have a version of this library for B4I please? Scratch that - just copied the XML and Jar files and it seems to work in B4I as is. Sorry - it only seemed to work. When entering code the intellisense feature worked but then it fails to compile saying a parameter is missing. I thought that because it was basically a list of constants I could get away with using the B4A library in B4I, but that is wrong! Derek
Erel B4X founder Staff member Licensed User Longtime User Jul 30, 2015 #3 B4i works with Objective C libraries. I guess that you meant B4J.
Derek Johnson Active Member Licensed User Longtime User Jul 30, 2015 #4 I've now created a code module from the original library that is portable from B4A to B4I and I guess B4J. Just add the ColorByName.bas file as a code module. If you want to test it in B4A then don't forget to remove the original library from your project. It behaves in much the same way as the original library with Intellisense. Derek Attachments ColorByName.bas ColorByName.bas 7.6 KB · Views: 633
I've now created a code module from the original library that is portable from B4A to B4I and I guess B4J. Just add the ColorByName.bas file as a code module. If you want to test it in B4A then don't forget to remove the original library from your project. It behaves in much the same way as the original library with Intellisense. Derek
ArminKH Well-Known Member Jul 30, 2015 #5 thank u suggestion : if is possible please add Material Standard Colors to this for example Material_Red_500 or for text colors use this Material_LightBackground_87 like this : https://www.b4x.com/android/forum/threads/material-colors.53793/#content Last edited: Jul 30, 2015
thank u suggestion : if is possible please add Material Standard Colors to this for example Material_Red_500 or for text colors use this Material_LightBackground_87 like this : https://www.b4x.com/android/forum/threads/material-colors.53793/#content
Johan Schoeman Expert Licensed User Longtime User Jul 30, 2015 #6 This is the original project that I have created the lib from. The B4A code is in the ColorByName code module. Add the following to the code module to get for eg Material_Red_500: Code: Copy Public Sub Material_Red_500 As Int Return Colors.RGB(0xf4,0x43,0x36) 'RGB F44336 = Material Red 500 End Sub Get other Material colors here and just add to the code module.... Attachments JHS TEST COLOR.zip JHS TEST COLOR.zip 14.3 KB · Views: 574 Last edited: Jul 30, 2015
This is the original project that I have created the lib from. The B4A code is in the ColorByName code module. Add the following to the code module to get for eg Material_Red_500: Code: Copy Public Sub Material_Red_500 As Int Return Colors.RGB(0xf4,0x43,0x36) 'RGB F44336 = Material Red 500 End Sub Get other Material colors here and just add to the code module....
Johan Schoeman Expert Licensed User Longtime User Jul 30, 2015 #7 Just as an example... have added Material Red 500, 50, 100, 200, and 300 at the end of the code module. Do the same to add other material colors to the project and then compile it to a lib. Attachments JHS TEST COLOR ADDING MATERIAL COLORS.zip JHS TEST COLOR ADDING MATERIAL COLORS.zip 14.4 KB · Views: 587
Just as an example... have added Material Red 500, 50, 100, 200, and 300 at the end of the code module. Do the same to add other material colors to the project and then compile it to a lib.
Derek Johnson Active Member Licensed User Longtime User Jul 31, 2015 #8 I've just created this code module with all of the Material Standard Colors eg Code: Copy Public Const red_50=0XffFFEBEE As Int Public Const red_100=0XffFFCDD2 As Int Public Const red_200=0XffEF9A9A As Int Public Const red_300=0XffE57373 As Int ..... Public Const blue_grey_400=0Xff78909C As Int Public Const blue_grey_500=0Xff607D8B As Int Public Const blue_grey_600=0Xff546E7A As Int Public Const blue_grey_700=0Xff455A64 As Int Public Const blue_grey_800=0Xff37474F As Int Public Const blue_grey_900=0Xff263238 As Int Just add the MC.bas as a code module then you can use it like this: Code: Copy Sub Activity_Resume Panel1.Color=MC.yellow_A700 End Sub Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("1") End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub Panel1_Click Panel1.Color=MC.deep_purple_900 End Sub Should work in B4A, B4I and B4J Keywords: Material Design Colors Derek Attachments MC.bas MC.bas 12.2 KB · Views: 730
I've just created this code module with all of the Material Standard Colors eg Code: Copy Public Const red_50=0XffFFEBEE As Int Public Const red_100=0XffFFCDD2 As Int Public Const red_200=0XffEF9A9A As Int Public Const red_300=0XffE57373 As Int ..... Public Const blue_grey_400=0Xff78909C As Int Public Const blue_grey_500=0Xff607D8B As Int Public Const blue_grey_600=0Xff546E7A As Int Public Const blue_grey_700=0Xff455A64 As Int Public Const blue_grey_800=0Xff37474F As Int Public Const blue_grey_900=0Xff263238 As Int Just add the MC.bas as a code module then you can use it like this: Code: Copy Sub Activity_Resume Panel1.Color=MC.yellow_A700 End Sub Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("1") End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub Panel1_Click Panel1.Color=MC.deep_purple_900 End Sub Should work in B4A, B4I and B4J Keywords: Material Design Colors Derek