Options options = Options(format: Format.hsl, colorType: ColorType.red, luminosity: Luminosity.light) Return a single color of light red in hsl format Options options = Options(format: Format.rgba, colorType: ColorType.blue, count:10) Return an array of ten green colors in hex format I.e Options class has a default value of the following ColorType: random, Luminiosity:random, Format:hex, alpha:1.0 * Return a single color of type random, luminiosity random, format hex, alpha 1.0, and count is 1 Options options = Options(format: Format.rgba, colorType: ColorType.blue) it is only neccessary when generating color that is greater than 1 Examples # // Return a single blue color in rgba format it is only neccessary on rgba, hsla.Ĭount - This control the length of the generated color. format is a enum data type of the following:- rgba, rgb, rgbArray, hsla, hex, hsl, hsva, hsvArray, hslArray.Īlpha - This control the opacity of the generated color, it is a decimal between 0 to 1. luminosity is a enum data type of the following:- random, dark, light, brightįormat - This control the format of the generated color, it tells the output format of the color. Luminosity - This control the luminosity of the generated color. it either accept ColorType data or List for collection of specific colors colortype is a enum data type of the following:- random, monochrome, red, orange, yellow, green, blue, purple, pink. The options object accepts the following propertiesĬolorType - This control the type of color to be generated. You can pass an option to influence the type of color it produces. Var color = RandomColor.getColor(options) How to use # var options = Options(format: Format.hex, colorType: een) This is a Dart port of David Merfield randomColor Javascript utility A dart package for generating attractive random colors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |