Shadow Color Derived From Base Alpha
Derive base-colored shadow by caller linear-light retention and separate alpha, outputting safe CSS; does not composite against unknown backdrop, multiply alpha twice or determine a visual depth/contrast guarantee.
Description
A colored shadow can reduce linear light while retaining independent alpha.
A colored shadow can reduce linear light while retaining independent alpha. Alpha is not another channel-darkening factor.1
Enter normalized RGB and retention/alpha fractions 0–1. Return shadow RGB and CSS rgb with rounded 0–255 channels and declared alpha.
When to use Shadow Color Derived From Base Alpha
Use Shadow Color Derived From Base Alpha when you need to evaluate the supplied records under the calculation and evidence rules below. No unknown-background compositing, visual-depth guarantee or contrast check is performed.
Prepare colors in the stated color space and scale. Use encoded RGB fractions, linear RGB, Lab, xy, byte values or ink percentages exactly as requested; supply caller tolerances and reference conditions.
How to use Shadow Color Derived From Base Alpha and understand its results
- Prepare colors in the stated color space and scale. Use encoded RGB fractions, linear RGB, Lab, xy, byte values or ink percentages exactly as requested; supply caller tolerances and reference conditions.
- Enter baseRgb, linearLightRetentionFraction, shadowAlphaFraction using the field table and calculation rules, then run the tool.
- Read shadowRgb, shadowCss. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| baseRgb | Base rgb | list of number | Required |
| linearLightRetentionFraction | Linear light retention fraction | number | Required |
| shadowAlphaFraction | Shadow alpha fraction | number | Required |
Enter normalized RGB and retention/alpha fractions 0–1. Return shadow RGB and CSS rgb with rounded 0–255 channels and declared alpha.
shadowChannel=encode(decode(baseChannel)×retention) Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| shadowRgb | Shadow rgb | list of number |
| shadowCss | Shadow css | string |
{
"input": {
"baseRgb": [
1,
0,
0
],
"linearLightRetentionFraction": 0,
"shadowAlphaFraction": 0.25
},
"output": {
"shadowRgb": [
0,
0,
0
],
"shadowCss": "rgb(0 0 0 / 0.25)"
}
} Limitations and assumptions
No unknown-background compositing, visual-depth guarantee or contrast check is performed.
Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Numeric lists are limited to 10,000 entries; string lists to 128 strings of at most 128 characters each. The rules above may impose smaller limits. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use Color Shade and Tint Generator: Tint and shade ladders mix toward white and black respectively. The declared method operates on encoded sRGB. For a complementary task, use Auto Black/White Text Picker: Opaque background relative luminance determines black and white text contrast. The larger ratio is an objective choice within these two candidates.
References
-
Shadow Color Derived From Base Alpha — tool.io
Similar or alternative tools
- Color Shade and Tint Generator
Tint and shade ladders mix toward white and black respectively. The declared method operates on encoded sRGB.
- Auto Black/White Text Picker
Opaque background relative luminance determines black and white text contrast. The larger ratio is an objective choice within these two candidates.