Skip to content

Commit

Permalink
added getTransparentColor
Browse files Browse the repository at this point in the history
  • Loading branch information
Pujan92 committed Sep 4, 2023
1 parent 4984b39 commit ca83280
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/DistanceRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import MenuItemWithTopDescription from './MenuItemWithTopDescription';
import {iouPropTypes} from '../pages/iou/propTypes';
import reportPropTypes from '../pages/reportPropTypes';
import * as IOU from '../libs/actions/IOU';
import * as StyleUtils from '../styles/StyleUtils';

const MAX_WAYPOINTS = 25;
const MAX_WAYPOINTS_TO_DISPLAY = 4;
Expand Down Expand Up @@ -212,7 +213,7 @@ function DistanceRequest({iou, iouType, report, transaction, mapboxAccessToken})
{shouldShowGradient && (
<LinearGradient
style={[styles.pAbsolute, styles.b0, styles.l0, styles.r0, {height: halfMenuItemHeight}]}
colors={[`${theme.modalBackground}00`, theme.modalBackground]}
colors={[StyleUtils.getTransparentColor(theme.modalBackground), theme.modalBackground]}
/>
)}
{hasRouteError && (
Expand Down
8 changes: 8 additions & 0 deletions src/styles/StyleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,13 @@ function getDropDownButtonHeight(buttonSize: ButtonSizeValue): ViewStyle | CSSPr
};
}

/**
* Get transparent color by setting alpha value 0 of the passed color
*/
function getTransparentColor(color: string) {
return `${color}00`;
}

export {
getAvatarSize,
getAvatarWidthStyle,
Expand Down Expand Up @@ -1256,4 +1263,5 @@ export {
getDisabledLinkStyles,
getCheckboxContainerStyle,
getDropDownButtonHeight,
getTransparentColor,
};

0 comments on commit ca83280

Please sign in to comment.