In addition to the predefined modifier variables in the b
package, the color modifiers provide methods to generate corresponding variants:
Method | Action |
---|
.Base() | Return the equivalent base color (for use within components or elements that support color) |
.Text() | Return the equivalent text color |
.Background() | Return the equivalent background color |
.Normal() | Remove any variant or shade on the color |
.Light() | Return the equivalent light variant |
.Dark() | Return the equivalent dark variant |
.Soft() | Return the equivalent soft variant |
.Bold() | Return the equivalent bold variant |
.OnScheme() | Return the equivalent on-scheme variant |
.Shade(int) | Return the equivalent shade variant (the integer value must be one of 0, 5, 10, ... 95, 100) |
.Invert() | Return the equivalent inverted color (for inverted colors, it returns the non-inverted equivalent; for base colors, it returns the same color because base colors have no inverted equivalent) |
These methods allow easily generate custom components with adequate colors, for example: